0

I need to put the related products on my site on the right column.

By default the site product design is set to 2 columns with left bar, but I changed it 2 columns with right bar.

Now what I need to do is modify the catalogs.xml file so that related products appear on the right column and not in a tab.

This is a sample product: http://www.theprinterdepo.com/hp-laser-1320-printer-q5927a

This is the relevant part of the catalog.xml

<!--
Product view
-->

    <catalog_product_view translate="label">
        <label>Catalog Product View (Any)</label>
        <!-- Mage_Catalog -->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
        </reference>
        <reference name="head">
            <action method="addJs"><script>varien/product.js</script></action>

            <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
            <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
            <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
        </reference>
        <reference name="content">
 <block type="catalog/product_view" name="product.countdown" as="countdown" template="paytype/countdown/countdown.phtml"/>
            <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
                <!--
                <action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/summary.phtml</template></action>
                <action method="addReviewSummaryTemplate"><type>short</type><template>review/helper/summary_short.phtml</template></action>
                <action method="addReviewSummaryTemplate"><type>...</type><template>...</template></action>
                -->
                <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
                <block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
                    <label>Alert Urls</label>
                </block>

                <action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>

                <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
                    <action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
<action method="addTab" translate="title" module="catalog"><alias>upsell_products</alias><title>Supplies and Accesories</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>

                    <action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>
                </block>

                <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
                <block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
                <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>

                <block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
                    <label>Product View Extra Hint</label>
                </block>

                <block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
                    <label>Info Column Options Wrapper</label>
                    <block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
                    <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
                        <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
                        <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
                        <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
                        <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
                    </block>
                    <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
                </block>
                <block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml" translate="label">
                    <label>Bottom Block Options Wrapper</label>
                    <action method="insert"><block>product.tierprices</block></action>
                    <block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
                    <action method="append"><block>product.info.addtocart</block></action>
                    <action method="append"><block>product.info.addto</block></action>
                </block>

                <block type="core/template_facade" name="product.info.container1" as="container1">
                    <action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
                    <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
                    <action method="append"><block>product.info.options.wrapper</block></action>
                    <action method="append"><block>product.info.options.wrapper.bottom</block></action>
                </block>
                <block type="core/template_facade" name="product.info.container2" as="container2">
                    <action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
                    <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
                    <action method="append"><block>product.info.options.wrapper</block></action>
                    <action method="append"><block>product.info.options.wrapper.bottom</block></action>
                </block>
                <action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
                <action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
            </block>
        </reference>
        <reference name="upsell_products">
            <action method="setColumnCount"><columns>5</columns></action>
            <action method="setItemLimit"><type>upsell</type><limit>100</limit></action>
        </reference>
        <reference name="left">
            <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
            <!--added on date 21-12-11-->
            <remove name="catalog.sidebar.left.top"/> 
            <remove name="catalog.sidebar.left.bottom"/>
            <!--end-->
        </reference>
    </catalog_product_view>

Update 1:

<reference name="left">
            <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
            <!--added on date 21-12-11-->
            <remove name="catalog.sidebar.left.top"/> 
            <remove name="catalog.sidebar.left.bottom"/>
            <!--end-->
        </reference>
        <reference name="right">
        <block type="catalog/product_list_related" name="catalog.product.related" template="catalog/product/list/related.phtml"/>
    </reference>

Update 2: easytabs.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">

    <default>
        <reference name="head">
            <action method="addItem" ifconfig="easy_tabs/general/enabled"><type>skin_css</type><name>css/easytabs.css</name></action>
        </reference>      
    </default>

    <catalog_product_view>

        <reference name="product.info">
                <action method="unsetChild" ifconfig="easy_tabs/general/additionaltabbed"><name>additional</name></action>                    
                <action method="unsetChild" ifconfig="easy_tabs/general/upsellproductstabbed"><name>upsell_products</name></action>
                <action method="setTemplate"><template>easytabs/catalogproductview.phtml</template></action>                
        </reference>

        <reference name="right">
            <action method="unsetChild" ifconfig="easy_tabs/general/relatedtabbed"><name>catalog.product.related</name></action>
        </reference>            

        <reference name="product.info.additional">
                <action method="unsetChild" ifconfig="easy_tabs/general/tagstabbed"><name>product_tag_list</name></action>
                <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs">
                    <action method="setTemplate" ifconfig="easy_tabs/general/enabled"><template>easytabs/tabs.phtml</template></action>

                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/upsellproductstabbed"><alias>upsell_products_tabbed</alias><title>We Also Recommend</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action> 

                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/descriptiontabbed"><alias>description_tabbed</alias><title>Product Description</title><block>catalog/product_view_description</block><template>easytabs/description.phtml</template></action>



                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/additionaltabbed"><alias>additional_tabbed</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>easytabs/attributes.phtml</template></action>

                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/relatedtabbed"><alias>related_tabbed</alias><title>Related Products</title><block>catalog/product_list_related</block><template>easytabs/catalogproductrelated.phtml</template></action>               
                    <action method="addTab" translate="title" module="tag" ifconfig="easy_tabs/general/tagstabbed"><alias>tags_tabbed</alias><title>Product Tags</title><block>tag/product_list</block><template>easytabs/catalogproducttags.phtml</template></action>
                    <action method="addTab" translate="title" module="review" ifconfig="easy_tabs/general/reviewtabbed"><alias>review_tabbed</alias><title>Product's Review</title><block>review/product_view_list</block><template>easytabs/catalogproductreview.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab"><alias>custom</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab1"><alias>custom1</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom1.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab2"><alias>custom2</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom2.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab3"><alias>custom3</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom3.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab4"><alias>custom4</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom4.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms"><alias>cms</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms1"><alias>cms1</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms1.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms2"><alias>cms2</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms2.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms3"><alias>cms3</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms3.phtml</template></action>
                    <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms4"><alias>cms4</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms4.phtml</template></action>
                </block>
        </reference>

    </catalog_product_view>
</layout>

2 Answers 2

1

This is all you need...

<catalog_product_view translate="label">

    <!-- Other layout xml here -->

    <reference name="right">
        <block type="catalog/product_list_related" name="catalog.product.right.related" template="catalog/product/list/related.phtml"/>
    </reference>

    <!-- Other layout xml here -->

</catalog_product_view>

If you require, you can position it in the right column in relation to other block by using the 'before' and 'after' attributes.

2
  • it didnt work, my guess a conflict with easytabs.xml? pls see the update. please see the update, I added the easytabs.xml file Jun 7, 2012 at 20:06
  • Yes that would cause an issue as the updated code you provided shows the catalog.product.related block being unset from the right block. To avoid this, simply give the related products block a different name - i have revised the code example for you Jun 7, 2012 at 20:09
1

add this block above the last line </catalog_product_view> same as <reference name="left">

<reference name="right">
     <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>

1
  • I already tried that but my guess is that there is a conflict with easytabs extension maybe? Jun 7, 2012 at 20:03

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.