how to show price in the product details page

As shown in the link, the price just doesn’t show up in the by-product details page, would appreciate it if you can advise us what to do? thanks!

And another question is: how to remove the picture (which says a 20% discount) from the left sidebar.

1 answer

Profile photo of tomc 0.00 $tone December 7, 2011
Public

The price at the top of the page is generally displayed as part of the “product type data”.

Check the file at template/catalog/product/view/type/simple.phtml.

In that page $this->getPriceHtml($_product); is responsible for displaying the top price in the product page.
So if you want to remove the top price remove $this->getPriceHtml($_product)from the simple.phtml.

The price at the bottom of the catalog page is a little more complicated. If you take a look atlayout/catalog.xml, the price block (product.clone_prices) is added to the blockproduct.info.options.wrapper.bottom, which is then added to product.info.container1 andproduct.info.container2. Depending on the product type, 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.

getChildHtml(‘product_type_data’) maps directly to catalog/product/view/type/simple.phtml.


Code:

  • <?php $_product = $this->getProduct() ?>
  • <div id="product-availability">Availability
  • <?php if($_product->isSaleable()): ?>
  • <span class="available"><?php echo$this->__('In stock') ?></span>
  • <?php else: ?>
  • <span class="unavailable"><?php echo$this->__('Out of stock') ?></span>
  • <?php endif; ?>
  • </div>
  • <div id="product-price">Price <span><?php echo$this->getPriceHtml($_product) ?></span></div>

Acquiring the price of the product is a simple method call away!

#1

Please login or Register to Submit Answer

Written By

Comments