magento中在购物车图标鼠标放上后可显示购物车中商品列表的代码,好模板提供如下图所示:
布局xml中的引用语法如下: 1 <default> 2 <reference name="header"> 3 <block type="checkout/cart_sidebar" name="cart_top" template="checkout/cart/topcart.phtml"> 4 <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action> 5 <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action> 6 <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action> 7 <block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout"> 8 <label>Shopping Cart Sidebar Extra Actions</label> 9 </block> 10 </block> 11 </reference> 12 </default> |