MSUK1 Posted January 5, 2011 Share Posted January 5, 2011 a douche hard coded my shopping carts VAT to 17.5% i wanted to just adjust the VAT in the shopping cart, but he has removed the feature.. so what i was thinking to counter it, was to make a php script that could EDIT all the prices in the database +2.5% can anybody help me with this please? Quote Link to comment Share on other sites More sharing options...
MSUK1 Posted January 5, 2011 Author Share Posted January 5, 2011 little bump Quote Link to comment Share on other sites More sharing options...
xox Posted January 5, 2011 Share Posted January 5, 2011 All you have to do is to show textbox and submit button, get current value from DB and then use the mysql UPDATE to save new value entered into textbox. Quote Link to comment Share on other sites More sharing options...
MSUK1 Posted January 5, 2011 Author Share Posted January 5, 2011 their is over 1000 products, the mysql export doesnt work, just crashes our phpmyadmin... so how can i get the php script to go through each entry all at once? and multiply current value by 2.5% Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted January 5, 2011 Share Posted January 5, 2011 one simple SQL statement: UPDATE products SET price = (price * 1.025) Quote Link to comment Share on other sites More sharing options...
MSUK1 Posted January 5, 2011 Author Share Posted January 5, 2011 thats genius ill give it a try! thankyou! Quote Link to comment Share on other sites More sharing options...
MSUK1 Posted January 6, 2011 Author Share Posted January 6, 2011 ok that was great! is there an sql command i can use to round all prices to nearest pound? i.e price: 74.53 -> 75.00 or 74.47 -> 74.00 Quote Link to comment Share on other sites More sharing options...
Rifts Posted January 6, 2011 Share Posted January 6, 2011 ROUND() Quote Link to comment Share on other sites More sharing options...
MSUK1 Posted January 6, 2011 Author Share Posted January 6, 2011 so... guessing UPDATE products SET price = (price = Round()) Quote Link to comment Share on other sites More sharing options...
Rifts Posted January 6, 2011 Share Posted January 6, 2011 something more like UPDATE products SET price = Round(price) Quote Link to comment Share on other sites More sharing options...
MSUK1 Posted January 6, 2011 Author Share Posted January 6, 2011 do i need to physically enter the price in the Round(price) or will it take hte price from the database? over 2500 products thats hte only reason thank-you by the way for your time Quote Link to comment Share on other sites More sharing options...
Rifts Posted January 6, 2011 Share Posted January 6, 2011 it should take the price from db Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.