Page 1 of 1

Hide Default Prices & Display Only Special Prices

Posted: Wed Jun 03, 2015 11:09 am
by ameliaa
Hi,

How do I hide the default prices (the one with the strikethrough) from frontend and display only the special/discounted prices?

I know I can change the color to white but the specials is aligned to the right and does not look good.

Hope someone can help me.

Thank you.

Re: Hide Default Prices & Display Only Special Prices

Posted: Wed Jun 03, 2015 5:10 pm
by D3MO
there is a lot more such locations but here is example of what you should do:

======================================================
IN catalog/theme/default/template/product/product.tpl FIND:
======================================================


<?php } else { ?>
<li><span style="text-decoration: line-through;"><?php echo $price; ?></span></li>
<li>
<h2><?php echo $special; ?></h2>
</li>
<?php } ?>

=============
REPLACE WITH:
=============

<?php } else { ?>
<h2><?php echo $special; ?></h2>
<?php } ?>




So it will show normal price on product details page if there is no special set and special price if there is special price set all you have to do is remove in all view files the striked trough price variable. i could create the vqmod or ocmod for all files on the stock opencart if you interested PM me:)

Re: Hide Default Prices & Display Only Special Prices

Posted: Fri Jun 05, 2015 12:23 pm
by ameliaa
D3MO wrote:there is a lot more such locations but here is example of what you should do:

======================================================
IN catalog/theme/default/template/product/product.tpl FIND:
======================================================


<?php } else { ?>
<li><span style="text-decoration: line-through;"><?php echo $price; ?></span></li>
<li>
<h2><?php echo $special; ?></h2>
</li>
<?php } ?>

=============
REPLACE WITH:
=============

<?php } else { ?>
<h2><?php echo $special; ?></h2>
<?php } ?>




So it will show normal price on product details page if there is no special set and special price if there is special price set all you have to do is remove in all view files the striked trough price variable. i could create the vqmod or ocmod for all files on the stock opencart if you interested PM me:)
Thank you..I will test this out.

Re: Hide Default Prices & Display Only Special Prices

Posted: Tue May 18, 2021 4:15 am
by hotris
What about opencart3. I have the same question but for opencart3?

Re: Hide Default Prices & Display Only Special Prices

Posted: Tue May 18, 2021 9:33 pm
by Johnathan
You should be able to do that by adding some CSS to your theme's main stylesheet:

/catalog/view/theme/YOURTHEME/stylesheet/stylesheet.css

You'd add some lines like this at the bottom, and it should hide all the non-special prices if a product is on special:

Code: Select all

.price-old {
     display: none;
 }