I want to show the product price only once on the Magento product page. Currently, it is displayed twice.
I tried to change app/design/frontend/base/default/template/catalog/product/price.phtml
,
but didn't get it. I also tried app/design/frontend/base/default/template/catalog/view.phtml
, but when I edited price.phtml
the price is not up.
So how can I do it? Any ideas?
Thanks.
This depends on which one you want to keep. The price at the top of the page is generally displayed as part of the "product type data". Take a look at template/catalog/product/view/type/simple.phtml
, where you should see $this->getPriceHtml($_product);
.
The price at the bottom of the catalog page is a little more complicated. If you take a look at layout/catalog.xml
, the price block (product.clone_prices) is added to the block product.info.options.wrapper.bottom
, which is then added to product.info.container1
and product.info.container2
. Depending on the product, one of these will be echoed on the page. You can, however, just remove the line for product.clone_prices and that should remove the price.
Hope that helps!
Thanks, Joe
Instead of deleting the cloned price from the catalog.xml itself, as suggested by Joseph, a more clean way is to remove the block in your local.xml layout file:
<catalog_product_view>
<reference name="product.info.container2">
<remove name="product.clone_prices"/>
</reference>
</catalog_product_view>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With