dsvcqvp139098 2013-09-06 05:46
浏览 21

Magento模块自定义块在产品详细信息页面中工作但不在列表和网格页面中工作?

In magento I am writing one module. In my module lets say I have mymodule.xml where I want to insert my own block after this block

<catalog_product_view>
    <reference name="product.info">
      <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
      </block>
    </reference>
  </catalog_product_view>

This one is working fine in product details view page but when I am trying to show the same block in product category view and list view its not working at all. The product list category is like this where I am inserting my code from mymodule.xml

    <catalog_product_list>
    <reference name="product.info">
       <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
      </block>
    </reference>
  </catalog_product_list>

When I am going to check the changes in list view I can't see any changes (after clearing cache). So can someone kindly tell me how to solve this issue. Any help and suggestions wll be really appreciable. Thanks..

  • 写回答

1条回答 默认 最新

  • dongzhou1901 2013-09-06 18:23
    关注

    Well, The xml code which you are using in the category page ( list page) is not correct. It should be like this :

    <catalog_category_default>
    <reference name="category.products">
        <block type="test/test" name="test" as="other" template="test/test.phtml" >
            <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
        </block>
    </reference></catalog_category_default>
    
    <catalog_category_layered>
    <reference name="category.products">
       <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
      </block>
    </reference>  </catalog_category_layered>
    

    Please try with that. And, if anything else, please contact me. Thanks.

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置