News:

Looking for documentation? Take a look on our wiki

Main Menu

Indication recomaded product on category page

Started by beny.rfg, March 15, 2016, 21:29:54 PM

Previous topic - Next topic

beny.rfg

I use Virtuemart 3 with 3rd party template,

if any product labeled as recommended, I need to make this designation appeared on the category page and product page.

Any ideas how to do it?

Thanks, Petr

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

beny.rfg

Yes, it looks like what I need!

But any easy solution how to do it? I feel that this function Virtuemart supports in the default template, but correct me if I'm wrong.

Ghost


jenkinhill

You are already using a third party template, so ask them to set it up if you don't understand how overrides work. No, it is not in default VM.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

beny.rfg

#5
I figured out a way to display the recommended label on product detail page:

Add this code to the place where you need in file: templates/your-template-name/html/com-virtuemart/productdetails/default.php (or create override)

<?php if ($this->product->product_special == 1) { 
          echo 
'<span class="product-sale"> ' .  vmText::_('SALE!') . '</span>';
          }
?>


Edit:

And category page:  templates/your-template-name/html/com-virtuemart/category/default.php

<?php if ($product->product_special == 1) { 
          echo 
'<span class="product-sale"> ' .  vmText::_('SALE!') . '</span>';
          }
?>