Magento: product specfic designs through 'Cust

2020-07-18 04:46发布

If I want to control how each product is displayed (i.e. a custom design when specified) my first thought is to do this:

  1. Create a custom view.phtml in template/catalog/product/my_view.phtml
  2. Navigate in the admin to Product->Design->Custom Layout Update
  3. Add this block:

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

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

2条回答
Lonely孤独者°
2楼-- · 2020-07-18 05:22

Found the answer:

<reference name="product.info">
    <action method="setTemplate"><template>catalog/product/NEW_VIEW.phtml</template></action>
</reference>
查看更多
三岁会撩人
3楼-- · 2020-07-18 05:31

Navigate in the admin to Product->Design->Custom Layout Update >
Add the below custom block. > It works for all the 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 below code in view.phtml

<?php echo $this->getChildHtml('modulename'); ?>
查看更多
登录 后发表回答