VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: biltong on November 30, 2016, 12:09:20 PM

Title: Global product price increase
Post by: biltong on November 30, 2016, 12:09:20 PM
Hi,

If I want to permanently increase the Cost Price on all products in the shop by x% starting from a specific date, do I simply do this by creating a new Calculation Rule?

Thanks
Title: Re: Global product price increase
Post by: AH on November 30, 2016, 13:10:45 PM
I would do this using SQL command directly in the database rather than using a rule as you want this to be permanent.



update YOURPREFIX_virtuemart_product_prices as p set p.product_price = p.product_price * 1.03


Test on a backup first.

Title: Re: Global product price increase
Post by: biltong on November 30, 2016, 18:15:02 PM
Thanks AH,

My client wants to schedule this for 1/1/17 AND wants to round the Final Price (cost price + 20% VAT) to the nearest 50p!

I don't suppose there's a way of entering a calculation in the Value field of the Tax Calculation rule is there?

If so, I will set this up as a Calc Rule and then subsequently do a db UPDATE to make it permanent - after the excesses of the New Year have worn off  :o ;D.

If not, I'd be very greatful for the SQL to update cost price to ((cost price + 20% VAT)*1.05 then rounded to nearest 0.5 then -20% VAT to get back to cost price)

Thanks!
Title: Re: Global product price increase
Post by: AH on December 01, 2016, 10:54:22 AM
biltong

You will need to create the calculation yourself for this one

However - you can run multiple updates to get the end result you require

You I would not use a rule to do this (not sure if you can round to whole 50p!)- as it is a fixed one off cost change

MYSQL - has rules for Rounding etc
Title: Re: Global product price increase
Post by: Studio 42 on December 01, 2016, 11:13:54 AM
I had same request using my VM be Pro tool, i think you are the same user?
Else in vm be PRO, you can export the displayed list as CSV then apply the rule in OO calc or ms Excel(or google sheet), check that the price is correct and reimport prices with Vm Be Pro.
For a simple rule you can use a muliplicator *1.05 in the batch processor, but this don't round it.
Title: Re: Global product price increase
Post by: biltong on December 01, 2016, 12:30:28 PM
Yes, that was me, thank you!