Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

change/move structural inside content block
 
cobasa000
Jr. Member
 
Total Posts:  13
Joined:  2008-10-22
 

i’m having a hard time moving the minicart inside the main content block for my category pages.

i’ve tried editing catalog.xml’s content reference block to include the minicart by adding:

<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml">
     <
action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
      <
action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
       <
action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
</
block>

so the content reference block is basically now:

content reference block
   view
      
list
      
cart
end content reference

but nothing shows up.

i’ve also tried looking at the html inside sidebar.phtml and putting it after the code on list.phtml, but the carts contents are not showing up—it always shows up as an empty cart.

i’m guessing that if i got the xml right, it would show up, but i’m not having any luck. any help is appreciated. i’ve seen quite a few posts, about moving the minicart from one structural block to another and positioning it in the existing content block, but i don’t see much about moving content blocks around. i did find a good post on moving header info around, but it referenced html templates that seem structurally different than the content reference block.

any help is appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cobasa000
Jr. Member
 
Total Posts:  13
Joined:  2008-10-22
 

i found the following method to work:

in catalog.xml inside reference block “content”, after “product_list”, i added:

<block type="checkout/cart_sidebar" name="cart_sidebar" before="-" template="checkout/cart/sidebar.phtml"/>

in /app/design/frontend/default/TEMPLATENAME/template/catalog/category/view.phtml, after the productlisting php tags i added,

<?php echo $this->getChildHtml('cart_sidebar'?>

other than adding some div styling to house the cart_sidebar, that was it.

i’m assuming my problem before what that i was trying to call the cart_sidebar in list.phtml, but when i went back and read my post, i realized that inside my layout file, i was setting it up inside view, not list.

to summarize, set up your content blocks in your layout file, then play close attention to where your content block falls so you reference it correctly in the template files.

anyway, i hope this helps someone out.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top