1

I am using the rwd theme in magento 1.9 and want to add the compare products block below the "shop by" section. I thought i could do it be editing the catalog.xml file and moving the code for the block from under the right section to the left, but it didn't seem to work even after flushing the cache.

from catalog.xml:

<!-- Mage_Catalog -->
        <reference name="left">
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
            <!--<block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">-->
                <!--<action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>-->
                <!--<action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (555) 555-0123.</alt></action>-->
                <!--<action method="setLinkUrl"><url>checkout/cart</url></action>-->
            <!--</block>-->
        </reference>
        <reference name="right">

            <!--<block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml">-->
                <!--<action method="setImgSrc"><src>images/media/col_right_callout.jpg</src></action>-->
                <!--<action method="setImgAlt" translate="alt" module="catalog"><alt>Keep your eyes open for our special Back to School items and save A LOT!</alt></action>-->
            <!--</block>-->
1

First you need remove default compare sidebar from category pages which is called in right side of all page using xml code: <remove name="catalog.compare.sidebar" /> and create new sidebar at category page then align it after layer navagation using after tag try this code

For Non-Anchor Category :

 <catalog_category_default translate="label">
     <remove name="catalog.compare.sidebar" />
        <reference name="left">
        <block type="catalog/product_compare_sidebar" after="catalog.leftnav" name="catalog.compare.newsidebar" template="catalog/product/compare/sidebar.phtml"/>
     </reference>
  </catalog_category_default>

For Non-Anchor Category :

 <catalog_category_layered translate="label">
<remove name="catalog.compare.sidebar" />
        <reference name="left">
        <block type="catalog/product_compare_sidebar" after="catalog.leftnav" name="catalog.compare.newsidebar" template="catalog/product/compare/sidebar.phtml"/>
     </reference>
  </catalog_category_layered>
4
  • I tried placing the first part of the code under: <!-- Category default layout --> and the second part under: <!-- Category layered navigation layout --> But i must be doing something wrong, it makes all of the product in the category page disappear. Am i missing a step? – scody Oct 25 '14 at 2:55
  • It doesn't work – Ashwani Shukla Jan 20 '16 at 7:45
  • Where are you show? – Amit Bera Jan 20 '16 at 7:53
  • i want to show it in left pane – Ashwani Shukla Jan 20 '16 at 9:12
0

add below code in catalog.xml in between

then in admin panel go to:

cms->pages-> home page -> click on home page then select design tab after select design tab select layout with two column with left bar

Then refresh the home page.

0

First of all create local.xml file under etc folder of your theme.

Inside local.xml

<remove name="catalog.compare.sidebar"/>

Again, copy catalog.xml file from rwd theme to your own theme.

Inside catalog.xml

change:

<reference name="right">
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/></reference>

To:

<reference name="left">
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.leftsidebar" as="catalog.compare.leftsidebar" template="catalog/product/compare/sidebar.phtml"/>

Notice the reference name and block name are changed. Now create a static block from CMS->Static Blocks->Add New Block. Under content area:

<?php echo $this->getChildHtml('catalog.compare.leftsidebar');?>

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.