tags:

views:

176

answers:

2

Hello,

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.

+1  A: 

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

Joseph Mastey
A: 

Price blocks are defined within layout files (XML), you just need to call them from within the template files to get them to show.

In your case it seems that you might have possibly defined them twice from two related XML files within the same block, or within one file and two related sections/views. This means that when you call a function $this->getPriceHtml($_product); XMl parser loads the price twice from two different files (tied to a certain block).

Also I've noticed this within catalog.xml file:

<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>

If this is what you are looking for then just experiment with blocks within XML files.

sandfighter