1

I am using Magegiant Daily Deal module to display deals in the left sidebar of the category listing page. The daily deals block currently shows at the top of the left sidebar. I want to move it after the "Browse By category" block (see image below) but I am not able to.

enter image description here

I the daily deal extension's xml file (app/design/frontend///layout/magegiant/dailydeal.xml) contains the following code:

<?xml version="1.0"?>
<layout version="0.1.0">

    <default>
        <reference name="top.links">
            <action method="addLink" translate="label title" module="dailydeal" ifconfig="dailydeal/general/enable" condition="1">
                <label>Daily deal</label>
                <url helper="dailydeal/getTopLink"/>
                <title>Daily deal</title>
                <prepare/>
                <urlParams/>
                <position>10</position>
            </action>
        </reference>
        <reference name="head">
            <action method="addCss" ifconfig="dailydeal/general/enable" condition="1">
                <stylesheet>css/magegiant/dailydeal.css</stylesheet>
            </action>
            <action method="addCss">
                <stylesheet>catalogcategorysearch/catalogcategorysearch.css</stylesheet>
            </action>
            <action method="addJs" ifconfig="dailydeal/general/enable" condition="1">
                <script>magegiant/dailydeal.js</script>
            </action>
        </reference>
        <reference name="header">
            <block type="catalogcategorysearch/form" name="top.search" as="topSearch" template="catalogsearch/form.phtml">
                <block type="catalogcategorysearch/form_contents" name="top.search.content" as="topSearchContent" template="catalogsearch/form/contents.phtml"/>
            </block>
        </reference>

        <reference name="left">
            <block type="dailydeal/sidebar" before="-" name="dailydeal.left.sidebar" ifconfig="dailydeal/general/enable">
                <action method="getLeft"/>
            </block>
        </reference>

        <reference name="right">

            <block type="dailydeal/sidebar" before="-" name="dailydeal.right.sidebar" ifconfig="dailydeal/general/enable">
                <action method="getRight"/>
            </block>

        </reference>
    </default>
    <dailydeal_index_index>
        <reference name="root">
            <action method="setTemplate">
                <template>page/2columns-left.phtml</template>
            </action>
        </reference>
        <reference name="content">
            <block type="dailydeal/dailydeal" name="dailydeal" template="magegiant/dailydeal/dailydeal.phtml" ifconfig="dailydeal/general/enable">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar"
                       template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
                </block>
                <action method="setToolbarBlockName">
                    <name>product_list_toolbar</name>
                </action>
            </block>
        </reference>
    </dailydeal_index_index>
    <catalog_product_view>
        <!--<reference name="root">-->
            <!--<action method="setTemplate">-->
                <!--<template>page/2columns-left.phtml</template>-->
            <!--</action>-->
        <!--</reference>-->
        <reference name="product.info.extrahint">
            <block type="dailydeal/productdailydeal" name="product.dailydeal" as="productdailydeal"
                   template="magegiant/dailydeal/product.phtml" before="-" ifconfig="dailydeal/general/enable">
            </block>
        </reference>
    </catalog_product_view>
</layout>

I tried changing the the left reference tag to the following:

1.

    <reference name="left">
        <block type="dailydeal/sidebar" after="-" name="dailydeal.left.sidebar" ifconfig="dailydeal/general/enable">
            <action method="getLeft"/>
        </block>
    </reference>

2.

    <reference name="left">
        <block type="dailydeal/sidebar" after="catalog.leftnav" name="dailydeal.left.sidebar" ifconfig="dailydeal/general/enable">
            <action method="getLeft"/>
        </block>
    </reference>

But none of them seems to work. Any idea how can I move it under the category block ?

3
  • still not able to resolve this, try each and every example available.
    – Amyth
    Commented Nov 26, 2015 at 21:22
  • Maybe it's stupid question, but I have to ask it: did you cleared the cache? ;]
    – SeStro
    Commented Nov 26, 2015 at 22:23
  • Yes, Did clear the cache, still doesn't work :/
    – Amyth
    Commented Nov 27, 2015 at 8:30

1 Answer 1

2

The problem is that the catalog.leftnav block is not created in the default handle, but in catalog_category_layered and catalog_category_default.

The default handle is processed before any page specific handle, that means your block is added before the catalog navigation block even exists. You need to move it down afterwards, in the category layout handles.

Add this code:

<catalog_category_default>
    <action method="unsetChild"><alias>dailydeal.left.sidebar</alias></action>
    <action method="append"><name>dailydeal.left.sidebar</name></action>
</catalog_category_default>
<catalog_category_layered>
    <action method="unsetChild"><alias>dailydeal.left.sidebar</alias></action>
    <action method="append"><name>dailydeal.left.sidebar</name></action>
</catalog_category_layered>

It will remove the already instantiated block from its parent and re-adds it at the end.

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