如果我想在每个产品视图页面上的"添加到购物车"按钮后显示我的模板文件,但它会显示在页面底部的内容中?
<layout>
<catalog_product_view>
<reference name="content">
<block type="test_example/example" name="product.example" after="product.info.addtocart" template="test/example/view.phtml"/>
</reference>
</catalog_product_view>
</layout>
我尝试过很多不同的
after="product.info.addtocart"
通过在文件中搜索布局块名称,但无论如何都会在页面底部显示所有内容。
最新回答
- 2019-8-161 #
- 2019-8-162 #
去
app/design/frontend/YourPackage/YourTheme/template/catalog/product/view/addtocart.phtml
以及
addtocart
之后的代码 按钮<?php echo $this->getLayout()->createBlock('test_example/example')->setTemplate('test/example/view.phtml')->toHtml(); ?>
相关问题
- magento 1.9:如果文章y在购物车中是N次,则免费提供第X条之一magento1.9magento1.8magentoshoppingcartpricerules2019-12-05 21:43
- magento 1.9:如何使用自定义逻辑扩展adminhtml JavaScript方法?magento1.9magentolayoutmagentoadminhtmlmagento1.14magentothemefallback2019-12-05 21:42
- magento 1.9:在联系我们页面上从左侧删除类别magento1.9magentolayoutmagentourlmagentocontactus2019-12-05 21:39
您可以直接将模板文件添加到
product.info.addtocart
块。