Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Price Once on Magento Product Page

Tags:

magento

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.

like image 831
user471987 Avatar asked Sep 14 '10 11:09

user471987


2 Answers

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

like image 55
Joe Mastey Avatar answered Oct 03 '22 05:10

Joe Mastey


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>
like image 41
Simon H Avatar answered Oct 03 '22 04:10

Simon H