【问题标题】:how to add a template within the checkout/cart/item/default.phtml (simple)如何在 checkout/cart/item/default.phtml 中添加模板(简单)
【发布时间】:2015-10-29 20:07:15
【问题描述】:

我想在checkout_cart_index的产品名称下添加一个自定义的phtml,发现checkout.xml中有一个

simplecheckout/cart_item_renderercheckout/cart/item/default.phtml

我想要的是,我想添加一个带有模板 (phtml) 的块,以便我可以使用 getchildhtml('xxx') 来调用模板,该模板在产品名称下显示一个文本。由于此 phtml 在其他地方使用,这就是为什么我希望这种方法使 phtml 可重用,有什么建议吗?,我使用的是 CE1.9 谢谢

【问题讨论】:

    标签: magento templates


    【解决方案1】:

    最好把下面的代码复制粘贴到产品名称后面的default.phtml中

    <?php echo $this->getLayout()->createBlock('blocktype')->setTemplate('temlate path')->tohtml(); ?>
    

    方块类型 - 你的方块类型

    templatepath - 你的 phtml 文件路径

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多