0

I am trying to display custom information for cross-sell items. I want to overwrite app/design/frontend/base/default/template/checkout/cart/crosssell.phtml

and use a new template in my module. I've tried a couple of ways to no avail. Here is my code:

in my config.xml

<frontend>
    <layout>
        <updates>
            <crosssellAttributes_layout module="CrosssellAttributes">
                <file>crosssellattributes.xml</file>
            </mymodulename_layout>
        </updates>
    </layout>
</frontend>

and in my layout modulename.xml

<?xml version="1.0"?>
<layout>
<checkout_cart_crosssell>
    <reference name="checkout.cart.crosssell">
        <block type="napkinstudio_productcrosssell/catalog_product_view_crosssell" name="product.view.crosssell" as="crosssell" template="[templatename]/productcrosssell.phtml" />
        <action method="setTemplate">
            <template>[templatename]/productcrosssell.phtml</template>
        </action>
    </reference>
</checkout_cart_crosssell>

I want it to point to my child theme file, but can't seem to get it right. Any pointers would be greatly appreciated! Thank you.

0

Change your config.xml code

<frontend>
    <layout>
        <updates>
            <crosssellAttributes_layout module="CrosssellAttributes">
                <file>crosssellattributes.xml</file>
            </mymodulename_layout>
        </updates>
    </layout>
</frontend>

to:

<frontend>
    <layout>
        <updates>
            <crosssellAttributes>
                <file>crosssellattributes.xml</file>
            </crosssellAttributes>
        </updates>
    </layout>
</frontend>

In above code crosssellAttributes is your module group name

0

At first you config xml looks incorrect, should be something like

<frontend>
    <layout>
        <updates>
            <napkinstudio_productcrosssell>
                <file>crosssellattributes.xml</file>
            </napkinstudio_productcrosssell>
        </updates>
    </layout>
</frontend>

then you need to create crosssellattributes.xml file withing your design package layout folder

<?xml version="1.0"?>
<layout>
    <checkout_cart_index>
        <reference name="checkout.cart">
            <block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="napkinstudio_productcrosssell/cart/crosssell.phtml"/>
        </reference>
    </checkout_cart_index>
</layout>

and then you need to create a template file within you desing package theme template folder - napkinstudio_productcrosssell/cart/crosssell.phtml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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