Page 1 of 1
Remove price from homepage and category pages
Posted: Wed Apr 25, 2012 10:21 pm
by ryrocks
Hi,
Is it possible to remove the product price and "add to basket" button from the homepage (featured items) and category pages?
I only want to show the price and 'add to basket' button on the individual product page itself.
Thanks,
Ryan
Re: Remove price from homepage and category pages
Posted: Wed Apr 25, 2012 11:14 pm
by Avvici
You will do that in their respective tpl's
catalog/view/theme/your_theme/template/module/featured.tpl
Replace all of the code in the page with this:
Code: Select all
<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content">
<div class="box-product">
<?php foreach ($products as $product) { ?>
<div>
<?php if ($product['thumb']) { ?>
<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
<?php } ?>
<div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
</div>
<?php } ?>
</div>
</div>
</div>
Now you only display name and image.
Re: Remove price from homepage and category pages
Posted: Thu Apr 26, 2012 4:58 am
by ryrocks
Awesome
Please can you explain how I can do this for the category pages? And also the bestsellers and latest products?
Thanks,
Ryan
Re: Remove price from homepage and category pages
Posted: Thu Apr 26, 2012 5:45 am
by ryrocks
I have managed to remove it from the category, bestsellers, latest etc by adding display:none to the relevant css.
Example:
.product-list .cart {
display:none;
}
.product-list .price {
display:none;
}
I'm all proud of myself now

Re: Remove price from homepage and category pages
Posted: Thu Apr 26, 2012 6:55 am
by Avvici
Now you're thinking.!! Good job in using display:none; and not visibility:hidden ;
Re: Remove price from homepage and category pages
Posted: Fri May 18, 2012 11:26 pm
by ocmr
Hi Ryrocks,
I have the same demand from my employer to remove the price from category. But I'm not sure where to find the relevant css for category. Thanks for your advice
Re: Remove price from homepage and category pages
Posted: Fri May 18, 2012 11:33 pm
by ryrocks
You can edit all this from the main stylesheet found here:
catalog/view/theme/'your-template'/stylesheet
Re: Remove price from homepage and category pages
Posted: Sat May 19, 2012 12:07 am
by ocmr
That's what I thought the first time, but I did not replace the code, I just added another line. And that did not work well. Thanks for the advice.
Re: Remove price from homepage and category pages
Posted: Sat May 19, 2012 12:35 am
by ryrocks
Make sure you add it to the bottom of the CSS file. For my problem (see above), I added the following code to the bottom of the stylesheet:
Code: Select all
.product-list .cart {
display:none;
}
.product-list .price {
display:none;
}
Re: Remove price from homepage and category pages
Posted: Thu Mar 27, 2014 2:37 am
by kylefultz
okay I have tried all the above and still nothing in category view - its still showing price
put it in openshop theme, and default
have everything working perfect - just one more price to remove
Re: Remove price from homepage and category pages
Posted: Tue Apr 06, 2021 5:29 am
by mainapatrick2937
REMOVING PRICE FROME HOMEPAGE AND CATALOGUE IN OPENCART 3
Navigate to
/home/eapackag/public_html/catalog/view/theme/default/template/extension/module/featured.twig
then delete this line of code and save remember to make a backup before attempting
{% endif %}
{% if product.price %}
<p class="price">
{% if not product.special %}
{{ product.price }}
{% else %}
<span class="price-new">{{ product.special }}</span> <span class="price-old">{{ product.price }}</span>
{% endif %}
{% if product.tax %}
<span class="price-tax">{{ text_tax }} {{ product.tax }}</span>
{% endif %}
thats all