News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Change price for all product

Started by marvays, June 23, 2020, 18:17:43 PM

Previous topic - Next topic

marvays

Hi.
I have eshop. I have vat 27%
Now, i need make copy all site, and locate into another country. On new copy i need change vat into 20%, but I need the price with VAT to remain the same.
Can I change all product prices via the database at once? I need to do "price * 1.27 / 1.2". Then I can change the VAT rate to 20% and the resulting prices will remain de facto unchanged.

Can anyone write me a sql command?

AH

#1
Yes you can - and I will ignore the very dubious practice of using a decrease in VAT to increase gross pricing :-)

You can do this with a direct database table update using SQL

You will also need to only apply to items that are subject to VAT (the update below DOES NOT DO THAT!)



update YOURTABLEPREFIX_virtuemart_product_prices as c

# NOW SET SOMETHING set p.product_price = round(p.product_price,2)

SET c.product_price = round(c.product_price * YOURCALC,2)


Take a table copy first :-)
Regards
A

Joomla 3.10.11
php 8.0


AH

See my adjustment above as you will need to only apply to items that are subject to VAT
Regards
A

Joomla 3.10.11
php 8.0