3

I try to "extend" in my module the checkout/cart/item/default.phtml template but do not manage to find the good definition in layout.xml

<layout version="0.1.0">
    ...

    <checkout_cart_item_default>
        <reference name="checkout.cart">
            <action method="setTemplate">
                <template>quotemodule/checkout/cart/item/default.phtml</template>
            </action>
        </reference>    
    </checkout_cart_item_default>

</layout>

is not working.

1 Answer 1

3

There is no layout handle named "checkout_cart_item_default" The block definition "checkout.cart" is only under the layout handle "checkout_cart_index". So it should be:

<layout version="0.1.0">
    ...

    <checkout_cart_index>
        <reference name="checkout.cart">
            ...
        </reference>    
    </checkout_cart_index>

</layout>

I guess you want to set a template for an item. Each line sets a new template for items of a specific product type:

<reference name="checkout.cart">
    <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>quotemodule/checkout/cart/item/default.phtml</template></action>
    <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>quotemodule/checkout/cart/item/default.phtml</template></action>
    <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>quotemodule/checkout/cart/item/default.phtml</template></action>
    <action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>quotemodule/checkout/cart/item/default.phtml</template></action>
    <action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>quotemodule/checkout/cart/item/default.phtml</template></action>
    <action method="addItemRender"><type>giftvoucher</type><block>giftvoucher/cart_item</block><template>quotemodule/checkout/cart/item/default.phtml</template></action>
</reference>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.