VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: SAWebCo on May 04, 2022, 12:04:55 PM

Title: Virtuemart Discount Price Banner - % incorrect
Post by: SAWebCo on May 04, 2022, 12:04:55 PM
Hi guys.

I'm using Joomla 3.8.10, VM 3.8.9


Hoping someone can help with pricing etc.

I am showing a % Discount on my website in the product and category views.

The % amount is incorrect however.

After hours of trial and error, research and testing I cannot get it right or find how to fix it.

Please see attached screen-prints.


The % amount should be calculated using the 'Cost Price' (which is the 'base price' and includes VAT (15%)) and the 'Override' price.

E.g. 3,220 less 10% = 2,898

The correct amount should be a 10% discount but the banner/flag is showing 22%


I have tried playing with the numbers and rules in the back-end with no joy.

Please can someone help?

URL = https://www.kznsteelworx.co.za/shop


Thanks so much in advance.

J
Title: Re: Virtuemart Discount Price Banner - % incorrect
Post by: pinochico on May 04, 2022, 13:50:19 PM
We use plugin Labels (https://www.minijoomla.org/extensions/virtuemart-extensions/product-labels-for-virtuemart) and inside is labels for Sale too:

we calculate sale in %:

Add new option for Sale from list of Calc:
- DATax
- DBTax
- DBTaxBill
- DATaxBill

ADD of new claclulation for product without TAX

In this plugin we recalculate sale price right :)
Title: Re: Virtuemart Discount Price Banner - % incorrect
Post by: jenkinhill on May 04, 2022, 16:31:45 PM
Your "Final price" of 3703  is the base price 3220 + 15% (VAT)  which would normally be the value to be discounted.

You should not use "Override" at all, which is there for historical reasons to completely override any final product price. In fact Override has been removed in the latest VM4 release as it was causing so much confusion. 

You may have ended up with the right price in your case, but the discount % cannot be calculated based on that value.

The docs may help:
http://docs.virtuemart.net/manual/general-concepts/204-tax-and-calculation-rules-overview.html
http://docs.virtuemart.net/manual/products-menu/taxes-and-calculation-rules.html
Title: Re: Virtuemart Discount Price Banner - % incorrect
Post by: SAWebCo on May 05, 2022, 11:21:18 AM
Thank you Pinochico for your recommendation of using that labels plugin.

Unfortunately the 'Discount' label does not state the % discount and is therefore not ideal in this case.
Title: Re: Virtuemart Discount Price Banner - % incorrect
Post by: SAWebCo on May 05, 2022, 11:26:21 AM
Thanks jenkinhill for your response.

Yes, that makes sense.

We had to use the overide to show the old price versus the new and trigger the banner to show.

I did set up a discount rule and that worked but it didn't trigger the Discount % banner on the image so was not a workable solution.

Oh, well. I guess I will have to manually edit the picture and add a banner that way.
Title: Re: Virtuemart Discount Price Banner - % incorrect
Post by: pinochico on May 05, 2022, 13:57:42 PM
Quote from: SAWebCo on May 05, 2022, 11:21:18 AM
Unfortunately the 'Discount' label does not state the % discount and is therefore not ideal in this case.

oh man, and how did you find that out?  ;D
The label allows you to show the % discount and therefore is perfect for this exact situation, I guess I need to know since I'm the author :)
Or do you know something more than me?

https://www.kolo-park.cz/obchod/kola-a-elektrokola/radit_podle,datum_vytvoreni?keyword=
Label: Sleva -11%

https://www.kolo-park.cz/obchod/vyprodej