Add some block to product view page through module xml file Magento

大城市里の小女人 提交于 2019-12-01 13:34:50

try this:

<catalog_product_view>
        <reference name="alert.urls"> 
            <block type="total/prototal"  name="total_prototal" template="total.phtml" />  
        </reference>
</catalog_product_view>

make sure this line must be exist in view.phtml file:

<?php echo $this->getChildHtml('alert_urls') ?>

Hope this helps!

I assume you have file and folder in your design like this

/template/total/prototal.phtml

In your local.xml you can add like below

<catalog_product_view>
     <reference name="product.info">
           <block type="core/template" name="total_prototal" template="total/prototal.phtml" after="product.info.addtocart"/>
      </reference>
</catalog_product_view>

Now in your catalog/product/view.phtml, call your custom block

Before

<?php echo $this->getChildHtml('addtocart') ?>

Add

<?php echo $this->getChildHtml('total_prototal') ?>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!