0

Magento 1.9.1.1 with rwd theme. I'm trying to place the existing header minicart block (not the sidebar.phtml) within a cms page . I've tried using following

{{block type="checkout/cart_sidebar" template="checkout/cart/minicart.phtml"}} and I get the icon and count but not the block content.

1
  • in minicart.phtml only cart count is added but the items are rendered in child block you can see there is calling of childhtml block in minicart.phtml. Commented Jul 31, 2015 at 17:43

1 Answer 1

0

There is no way to call child block through CMS content.

But we can achieve this by CMS page layout section To get the minicart.phtml file.

Add below code to CMS page > design > layout.

<reference name="content">
            <block type="checkout/cart_minicart" name="minicart_head_cms" template="checkout/cart/minicart.phtml" before="-">
                <block type="checkout/cart_sidebar" name="minicart_content_cms" template="checkout/cart/minicart/items.phtml">
                    <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>
                    <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>
                    <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/minicart/default.phtml</template></action>
                    <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/minicart/default.phtml</template></action>
                   <block type="core/text_list" name="cart_sidebar.cart_promotion_cms" as="cart_promotion" translate="label" module="checkout">
                        <label>Mini-cart promotion block</label>
                    </block>
                    <block type="core/text_list" name="cart_sidebar.extra_actions_cms" as="extra_actions" translate="label" module="checkout">
                        <label>Shopping Cart Sidebar Extra Actions</label>
                    </block>
                </block>
            </block>
        </reference>
3
  • This is great thanks. The only thing missing when it renders is <table class="info-wrapper"> which contains the price and editable quantity box. How would I also get that? Commented Aug 1, 2015 at 5:01
  • Seems to be calling sidebar/default.phtml rather than minicart/default.phtml Commented Aug 1, 2015 at 5:31
  • Clearing the cache solved that issue of calling sidebar/default.phtml. So using the above answer and also editing minicart/items.phtml using this solution magento.stackexchange.com/a/26146/9959 puts the whole minicart layout into sidebar. Commented Aug 1, 2015 at 5:42

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.