0

we created own theme by extending rwd theme and cart page was using below file code :

app/design/frontend/rwd/theme1/template/checkout/cart/default.phtml

we created custom module and it includes some features in Listing, view & cart page :

after installing module, cart page is displaying using below code.

app/design/frontend/base/default/template/module/cart/item/default.phtml = > cart page.

we dont need features present in cart page, so we renamed the default.phtml file

but than i thought it will use fallback and cart page will display using below path

app/design/frontend/rwd/theme1/template/checkout/cart/default.phtml

but now in cart page, "name, sku, price" and no other information are displaying.

layout file of module :

<?xml version="1.0"?>
<layout version="0.1.0">
    <checkout_cart_index>
        <reference name="checkout.cart">
            <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>preorder/cart/item/default.phtml</template></action>
            <action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>preorder/cart/item/default.phtml</template></action>
            <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer</block><template>preorder/cart/item/default.phtml</template></action>
        </reference>
    </checkout_cart_index>
    <catalog_product_view>
        <reference name="head">
            <action method="addCss"><stylesheet>preorder/css/custom.css</stylesheet></action>
        </reference>
        <reference name="product.info.addtocart">
            <action method="setTemplate">
                <template>preorder/product/all-view.phtml</template>
            </action>
            <block type="catalog/product_view" name="addtocart14" template="preorder/product/view/addtocart14.phtml"/>
            <block type="catalog/product_view" name="addtocart17" template="preorder/product/view/addtocart17.phtml"/>
        </reference>
    </catalog_product_view>
    <catalog_category_default>
        <reference name="product_list">
            <action method="setTemplate">
                <template>preorder/product/all-list.phtml</template>
            </action>
            <block type="catalog/product_list" name="list14" template="preorder/product/list/list14.phtml"/>
            <block type="catalog/product_list" name="list15" template="preorder/product/list/list15.phtml"/>
            <block type="catalog/product_list" name="list16" template="preorder/product/list/list16.phtml"/>
            <block type="catalog/product_list" name="list17" template="preorder/product/list/list17.phtml"/>
        </reference>
    </catalog_category_default>
    <catalog_category_layered>
        <reference name="product_list">
            <action method="setTemplate">
                <template>preorder/product/all-list.phtml</template>
            </action>
            <block type="catalog/product_list" name="list14" template="preorder/product/list/list14.phtml"/>
            <block type="catalog/product_list" name="list15" template="preorder/product/list/list15.phtml"/>
            <block type="catalog/product_list" name="list16" template="preorder/product/list/list16.phtml"/>
            <block type="catalog/product_list" name="list17" template="preorder/product/list/list17.phtml"/>
        </reference>
    </catalog_category_layered>
    <catalogsearch_result_index>
        <reference name="search_result_list">
            <action method="setTemplate">
                <template>preorder/product/all-list.phtml</template>
            </action>
            <block type="catalog/product_list" name="list14" template="preorder/product/list/list14.phtml"/>
            <block type="catalog/product_list" name="list15" template="preorder/product/list/list15.phtml"/>
            <block type="catalog/product_list" name="list16" template="preorder/product/list/list16.phtml"/>
            <block type="catalog/product_list" name="list17" template="preorder/product/list/list17.phtml"/>
        </reference>
    </catalogsearch_result_index>
    <catalogsearch_advanced_result>
        <reference name="search_result_list">
            <action method="setTemplate">
                <template>preorder/product/all-list.phtml</template>
            </action>
            <block type="catalog/product_list" name="list14" template="preorder/product/list/list14.phtml"/>
            <block type="catalog/product_list" name="list15" template="preorder/product/list/list15.phtml"/>
            <block type="catalog/product_list" name="list16" template="preorder/product/list/list16.phtml"/>
            <block type="catalog/product_list" name="list17" template="preorder/product/list/list17.phtml"/>
        </reference>
    </catalogsearch_advanced_result>
    <tag_product_list>
        <reference name="search_result_list">
            <action method="setTemplate">
                <template>preorder/product/all-list.phtml</template>
            </action>
            <block type="catalog/product_list" name="list14" template="preorder/product/list/list14.phtml"/>
            <block type="catalog/product_list" name="list15" template="preorder/product/list/list15.phtml"/>
            <block type="catalog/product_list" name="list16" template="preorder/product/list/list16.phtml"/>
            <block type="catalog/product_list" name="list17" template="preorder/product/list/list17.phtml"/>
        </reference>
    </tag_product_list>


</layout> 
2
  • are u rename app/design/frontend/base/default/template/module/cart/item/default.phtml?
    – Amit Bera
    Commented May 6, 2016 at 11:10
  • @AmitBera you are right. Commented May 6, 2016 at 11:12

2 Answers 2

1

for this you have to place the default magento default.phtml file at app/design/frontend/rwd/theme1/template/module/cart/item/default.phtml

as your module is active and you have define in your module to get this file from app/design/frontend/base/default/template/module/cart/item/default.phtml directory if you don't want to load this file then either remove this from configuration or place a default one in your modules directory as mentioned above.

You might have defined in your modules layout file to use app/design/frontend/rwd/theme1/template/module/cart/item/default.phtml either change your layout file or place the default magento file in your theme for the same location.

hope this will help you.

4
  • let me check , i will let you know soon Commented May 6, 2016 at 11:23
  • i updated layouts module file, please check in question. and tell me what i need to change to fix this issue , i dont want to copy the code of the theme1/default.phtml to module/default.phtml Commented May 6, 2016 at 11:28
  • you need to update code <reference name="checkout.cart"> <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>preorder/cart/item/default.phtml</template></action> <action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>preorder/cart/item/default.phtml</template></action> <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer</block><template>preorder/cart/item/default.phtml</template></action> </reference> Commented May 6, 2016 at 11:32
  • if you remove this code you will be able to load default magento file. either remove this or update new path. Commented May 6, 2016 at 11:34
1

As per as question your custom module have changes--

Cart item's phtml file

from checkout/cart/default.phtml

to module/checkout/cart/default.phtml

At default, Cart items in cart page are render from different block classe but call same phtml for render view.

<checkout_cart_index translate="label">
................
        <reference name="content">
            <block type="checkout/cart" name="checkout.cart">
                <action method="setCartTemplate"><value>checkout/cart.phtml</value></action>
                <action method="setEmptyTemplate"><value>checkout/cart/noItems.phtml</value></action>
                <action method="chooseTemplate"/>
                <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/item/default.phtml</template></action>
                <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/item/default.phtml</template></action>
                <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/item/default.phtml</template></action>

.........

You have see that if

  • a Cart item product type is simple then it view render from Mage_Checkout_Block_Cart_Item_Renderer.

a Cart item product type is grouped then it view render from Mage_Checkout_Block_Cart_Item_Renderer_Grouped.

etc.

May those block classes are rewrited by your module or change by your module layout file. which changed your cart item phtml file location as you mentioned

For your solution copy :

app/design/frontend/rwd/theme1/template/checkout/cart/default.phtml to

app/design/frontend/YourPackage/YourTheme/template/module/checkout/cart/default.phtml
3
  • means are you telling i have to copy the default.phtml from theme and i have to paste in module/checkout/cart.phtml ? Commented May 6, 2016 at 11:23
  • i updated layouts module file, please check in question. and tell me what i need to change to fix this issue , i dont want to copy the code of the theme1/default.phtml to module/default.phtml Commented May 6, 2016 at 11:27
  • It's really nice & usefull information. I follwed your solution. It worked fine. But as other user gave the answer first, i accept his answer. Commented May 6, 2016 at 11:56

Your Answer

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

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