Magento: Product Specifications Through Custom Layout Update

If I want to control how each product is displayed (i.e. custom design when it is listed), my first thought is this:

  • Create custom view.phtml in template / directory / product / my_view.phtml
  • Go to Admin to Product-> Design-> Custom Layout Update
  • Add this block:

<reference name="content"> <action method="setTemplate"> <template>catalog/product/view_print.phtml</template> </action> </reference> 

But the template never loads, only the default view.phtml. Is this the correct method? I need to be able to do this in the product settings.

+4
source share
2 answers

Found answer:

 <reference name="product.info"> <action method="setTemplate"><template>catalog/product/NEW_VIEW.phtml</template></action> </reference> 
+10
source

Go to admin to Product-> Design-> Custom Layout Update>
Add the following custom block. > It works for all stores.

 "<reference name="product.info"> <block type="namespace_modulename/catalog_product_list_custom" name="catalog.product.modulename" as="modulename" after="tierprices" template="modulename/catalog/product/modulename.phtml"/> </reference> " 

Add the code below to view.phtml

 <?php echo $this->getChildHtml('modulename'); ?> 
-one
source

Source: https://habr.com/ru/post/1392991/


All Articles