VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: cvrak on October 05, 2020, 10:04:42 AM

Title: Show product discount only at selected products
Post by: cvrak on October 05, 2020, 10:04:42 AM
Hi,
I've set a discount rule for a specific products category. Products of this category shows price before discount and price after discount.

The problem is that the products of other categories without discount show both prices (before and after discount) which are the same. How can i show only the final price for these products?

Joomla 3.9.21
php 7.3.22
VM 3.8.4
Title: Re: Show product discount only at selected products
Post by: Jörgen on October 05, 2020, 10:22:33 AM
Does this have anything to do with the discount rule ? If you take the discount away does it still show duplicates ?

If not, You have a setup mismatch in VM configuration->Prices

Please check Your settings.
Title: Re: Show product discount only at selected products
Post by: jenkinhill on October 05, 2020, 10:24:47 AM
Use a template/sublayout override for the discount category only.
Title: Re: Show product discount only at selected products
Post by: cvrak on October 05, 2020, 10:37:21 AM
Quote from: Jörgen on October 05, 2020, 10:22:33 AM
Does this have anything to do with the discount rule ? If you take the discount away does it still show duplicates ?

If not, You have a setup mismatch in VM configuration->Prices

Please check Your settings.

I unpublished the rule and I see duplicates. Attached you see my prices settings. Do I have to change some setting?
Title: Re: Show product discount only at selected products
Post by: cvrak on October 05, 2020, 10:38:19 AM
Quote from: jenkinhill on October 05, 2020, 10:24:47 AM
Use a template/sublayout override for the discount category only.

Do I have to change some code? Pls can you explain?
Thanks
Title: Re: Show product discount only at selected products
Post by: jenkinhill on October 05, 2020, 16:01:43 PM
You would have to edit a couple of sublayout template files (probably products.php and prices.php) and use the edited files as overrides. See http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html
Title: Re: Show product discount only at selected products
Post by: Jörgen on October 05, 2020, 21:03:02 PM
If I understand this correctly you only have to publish the right prices. Play around with the available prices and see what You get published. Compare the discounted category and see if You see any differences to the other categories.
Should You not find a suitable mix of price display, then first You will have to edit products.php and prices.php

Jörgen