socom Posted June 18, 2015 Share Posted June 18, 2015 Hi having some issue need to do the following via sql What do i need to type for the following 1) to reduce all NET prices by 20% (/1.2) 2) change all product from taxable good NONE to taxable goods Laurence Link to comment Share on other sites More sharing options...
burt Posted June 18, 2015 Share Posted June 18, 2015 You will find useable code at http://www.oscommerce.com/forums/topic/389955-useful-snippets-of-code/ Ensure to backup your database prior to using phpmyadmin. Link to comment Share on other sites More sharing options...
socom Posted June 18, 2015 Author Share Posted June 18, 2015 ok thanks im unable to find the table for the net price though? as i dont want the gross price to change when i change to taxable goods? Link to comment Share on other sites More sharing options...
socom Posted June 18, 2015 Author Share Posted June 18, 2015 or is products_price the net price then tax added on via script? Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted June 18, 2015 Share Posted June 18, 2015 or is products_price the net price then tax added on via script?yes KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
socom Posted June 18, 2015 Author Share Posted June 18, 2015 would these codes work ok? To lower price by 20% UPDATE `products` SET `products_price` = (ceil(`products_price`)/1.20); and change tax from non (0) to taxable goods 1? UPDATE products SET products_tax_class_id='1 WHERE something='0'; Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted June 18, 2015 Share Posted June 18, 2015 a 20% discount is * 0.8 --> 100 becomes 80 going from 80 to 100 is actually a 25% increase (ie 25% VAT rate on 80 excl VAT price) so rethink the exact value to use in your calculation update products set products_tax_class_id = 1 where (products_tax_class_id is null or products_tax_class_id = 0) KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
socom Posted June 22, 2015 Author Share Posted June 22, 2015 example 100 /1.2 = £83.33 then x 20% brings it back to 100? Laurence Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted June 22, 2015 Share Posted June 22, 2015 example 100 /1.2 = £83.33 then x 20% brings it back to 100? Laurence I'm sorry, isn't that basic math skills ? are you saying 20% VAT will bring it to 100 ? yes, it should KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
socom Posted June 23, 2015 Author Share Posted June 23, 2015 im sorry but yes but im just trying to double check before i run it all. im not a coder or a programmer and just making sure i do it correct first. after your last message i was double checking. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.