Magento 1.9-覆盖布局以在购物车页面上显示自定义属性(RWD主题)


Magento 1.9 - Override layout to display Custom Attribute on Cart Page (RWD Theme)

我正试图在SKU字段下方的购物车页面上显示自定义属性。我设法在这个位置使用以下代码app/design/frontend/rwd/default/template/checkout/cart/item

<div class="product-cart-sku">
  <span class="label"><?php echo $this->__('Points'); ?>:</span> <?php echo $_item->getProduct()->getData('customer_product_points'); ?>
</div>

default.phtml放置在位置app/design/frontend/base/default/template/namespace/modulename/checkout/cart/item不起作用。

如何覆盖默认布局以显示我的自定义属性?目前它获取rwd包。我不打算更改包,但如果安装了我的模块,它将调用我的item/default.phtml并显示属性。

尝试在我的布局xml中使用以下代码,但似乎不起作用。

<checkout_cart_index>
  <reference name ="checkout.cart">
        <block type="checkout/cart" name="checkout.cart">
                <action method="addItemRender">
                    <type>simple</type><block>checkout/cart_item_renderer</block><template>ei/productpoint/checkout/cart/item/default.phtml</template>
                </action>
            </block>
        </reference>
    </checkout_cart_index>

p.S.它应该适用于所有类型的产品

试试这个

<checkout_cart_index>
        <reference name="checkout.cart">
            <action method="setTemplate"><template>{your_namespace}/{your_modulename}/checkout/car‌​t/item/default.phtml</template></action>
        </reference>
</checkout_cart_index>