Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 Decrease all prices by 20%
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

IfOnly
VP-CART New User

United Kingdom
90 Posts

Posted - December 30 2004 :  10:07:27  Show Profile  Reply with Quote
Is there a way, either using the browser, or downloading the DB and using Access, that I can reduce all prices by 20% for a sale month and then return them to the original at the end of the sale.

Regards
Phil

Regards

Phil

devshb
Senior Member

United Kingdom
1904 Posts

Posted - December 30 2004 :  10:52:29  Show Profile  Visit devshb's Homepage  Reply with Quote
if i were in your shoes, I'd just run sqls to change the cprices rather than muck about with discount data etc; that'd be simplest/easiest.
and then make sure your product templates use the formatsaving function to display saved values.

ie in your templates have:

our price: [cprice]
rrp: [retailprice]
you save: [formatsaving cprice]

and then run sqls at the beginning/end of the sale.

if it's something you'd do fairly regularly, then it'd be a good idea to setup some basic asps that allow you to enter the reduction pct and then press a button to apply or reverse the price-savings accordingly (ie to run those sqls), you definitely shouldn't have to upload/download the database etc; just run some sqls via the site in asps.


eg to apply a 20% saving, your sql would be:

update products
set cprice=Round(
(
cprice * (
(100.0-20.0)
/
100.0
)
)
,2)


**important note!** to reverse a 20% discounted price, you would NOT multiply the reduced price by 1.2! (I think you'd divide it by 0.8 if my algebra's correct) which would make it look like....


update products
set cprice=Round(
(
cprice / (
(100.0-20.0)
/
100.0
)
)
,2)



Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons

Edited by - devshb on December 30 2004 11:03:36
Go to Top of Page

IfOnly
VP-CART New User

United Kingdom
90 Posts

Posted - December 31 2004 :  12:00:05  Show Profile  Reply with Quote
Simon - thanks ever so much for the time and trouble you have gone too.
I will try and implement this on a test basis during next week after the New Year break - hope you will not mind me coming back to you then through the forum.
I need to gen up on where I enter the SQL's in the admin section and do not have experience with making/running SQL's through ASP pages.

Thanks again

Phil

Regards

Phil
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - January 01 2005 :  07:40:36  Show Profile  Visit devshb's Homepage  Reply with Quote
I'm not sure if there's an admin area where you can run "execute" sqls (as opposed to normal queries) - we created a new screen for this on our admin, which was basically a copy of the advanced-query menu screen but without the query results/parsing etc so that it just did an execute command; we use it all the time for things like this.

if you've got sqlserver on your pc then you could just execute the command through enterprise manager, or your host might have a tool that will allow you to execute sqls via the web.

if you haven't got sqlserver on your pc, or a front-end tool from your host, tree the free/trial version of:
http://www.mylittletools.net/scripts/en/mla_sql/

it's great; very handy; just upload the asps they give you to your site and it means you don't need a sqlserver front end on your pc.

anyway, lots of hosts will block access to your sqlserver database via enterprise manager 'cos it's so full of security holes, so lots of hosts would probably point you in the direction of that kind of web-based tool.

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons

Edited by - devshb on January 01 2005 07:42:39
Go to Top of Page

IfOnly
VP-CART New User

United Kingdom
90 Posts

Posted - January 07 2005 :  09:25:34  Show Profile  Reply with Quote
Thanks Simon

I forgot to mention that I am using an Access Database, that comes with VP-ASP 5.50.
The 'my little admin' script seems to be for SQL servers; is there something else that will work please.

Regards
Phil

Regards

Phil
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - January 09 2005 :  17:49:10  Show Profile  Visit devshb's Homepage  Reply with Quote
you could login to the access front-end and run the update statements as a query (do create-query, then choose view>sqlview on the menu toolbar, then type in your update statement and then click the run button; that'll execute your update statement)

You could download your access file, run the query, then re-upload it again.

Alternatively, I understand that frontpage has got some kind of tool where you can open the access front-end remotely while it's still on your site, so you could try that.

Alternatively, you could create an asp that executes the update.

Also, the "mylittle" site also has an on-site access front-end too, like the sqlserver front end:

http://www.mylittletools.net/scripts/en/mla/default.asp

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons

Edited by - devshb on January 09 2005 17:50:11

Edited by - devshb on January 09 2005 17:51:21
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00