2

within the following file I can see below shown code:

File:

frontend/default/ves_fashion/template/common/list/default.phtml

Code:

<div class="price">
<?php echo $this->getPriceHtml($_product, true, $price_prefix) ?>
</div>

If I navigate to

frontend/default/ves_fashion/template/catalog/product/price.phtml

and make some changes to the price.phtml file, I can see the changes on two parts:

  1. The price which is shown for each product in the product overview section.
  2. The price which is shown for one product in the detail view.

How can I change the template that two different price templates are loaded - one for the overview section, and a different one for the detailed section?

I tried to rename

<?php echo $this->getPriceHtml($_product, true, $price_prefix) ?>

to

<?php echo $this->getPricelistHtml($_product, true, $price_prefix) ?>

And clone price.phtml as pricelist.phtml, but this is not working correctly.

Thanks for your help!

Torben
  • 231
  • 3
  • 11

1 Answers1

0

You can use addPriceBlockType, so for example:

<reference name="product_list">
   <action method="addPriceBlockType">
      <type>simple</type>
      <block>catalog/product_price</block>
      <template>catalog/product/list/custom-price.phtml</template>
   </action>
</reference>
Fran Mayers
  • 2,803
  • 9
  • 12
  • Hey Mayers, and where do i put this xml code reference? – Torben May 11 '15 at 10:15
  • In your layout xml : <catalog_category_layered> ...code here.. </catalog_category_layered> and <catalog_category_default> .. code here... </catalog_category_default> – Fran Mayers May 11 '15 at 10:22
  • I added it to both blocks directly before </catalog_category_default> and </catalog_category_layered>. I still use $this->getPriceHtml but the shop still takes template/catalog/product/price.phtml and not custom-price.html ... What is missing? Do you have an idea? – Torben May 11 '15 at 10:46
  • Hi Torben, it's hard to say without looking at the code. If you're not familiar with Magento, I would advise giving this to a Magento developer, as understanding layouts takes some practise. – Fran Mayers May 11 '15 at 12:42