VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: elthegr on May 22, 2019, 08:00:00 AM

Title: Problem with discounts
Post by: elthegr on May 22, 2019, 08:00:00 AM
Joomla! 3.6.4 Stable
When a product is on sale, it is displayed correctly in the product's category with its original price overwritten and the final price.
But on the home page where the offers are shown, only the final price is displayed.
I would also like all the products on sale to have a discount symbol on the photo.
Can you help me?
Thanks :)
Title: Re: Problem with discounts
Post by: StefanSTS on May 22, 2019, 08:51:52 AM
Hello,

you need to specify how you display the offers on your home page, which module type. VM products module or a template solution?
Also VM version and template version would be helpful.

Please do not add your shop's URL here to show your issue, otherwise Joomla 3.6.4 might be hacked in minutes, if your Joomla is not already hacked.

Regards
Stefan
Title: Re: Problem with discounts
Post by: elthegr on May 22, 2019, 09:39:50 AM
Thanks for your reply!
I'm not sure if the following helps:
It's Nano Virtuemart template compatible with the latest version of Virtuemart 3 for joomla 3.8

VirtueMart 3.0.18
Title: Re: Problem with discounts
Post by: Jörgen on May 22, 2019, 09:51:25 AM
If You can not give more info than this, no one can tell. This is clearly a template issue, please talk to Your template supplier. Test with Protostar. if it still does not show what You want, You will have to adjust settings in VM back end, configuration->prices.

Both Your Joomla and VM versions are outdated please update, on a backup of course.

Jörgen @ Kreativ Fotografi
Title: Re: Problem with discounts
Post by: GJC Web Design on May 22, 2019, 10:44:49 AM
check the template used for the home page ( modules or core ?) displays and what sublayout  prices is used etc...
Title: Re: Problem with discounts
Post by: jenkinhill on May 22, 2019, 13:55:09 PM
I just looked at the Nano demo on virtuemarttemplates.net and can see that the code to display prices on the home page is to show only the sale price, but on the product details page it shows  the base and sale prices. You will have to modify the overrides used to change the default display. Or try to get help from the template provider.  But it looks like you may need to update Joomla & VirtueMart versions as well.
Title: Re: Problem with discounts
Post by: StefanSTS on May 22, 2019, 14:35:05 PM
Nano has the prices in the default.php of the module override. They don't use the prices.php yet. They are still a bit VM2ish.
Title: Re: Problem with discounts
Post by: StefanSTS on May 22, 2019, 14:45:14 PM
You might want to add this in your templates overrides.
html/mod_virtuemart_product/default.php

<div class="pr-add-left">
   <a class="go-to-product" href="<?php echo $url ?>"><?php echo $product->product_name ?></a>        <?php
   // $product->prices is not set when show_prices in config is unchecked
   if ($show_price and  isset($product->prices)) {
      echo '<div class="product-price">'.$currency->createPriceDiv ('salesPrice', '', $product->prices, FALSE, FALSE, 1.0, TRUE);
      if ($product->prices['salesPriceWithDiscount'] > 0) {
         echo $currency->createPriceDiv ('salesPriceWithDiscount', '', $product->prices, FALSE, FALSE, 1.0, TRUE);
      }
      echo '</div>';
// this part is missing
      if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
         echo '<div class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices) . "</div>";
      }
// end of missing part
   }?>
</div>