1

I have a issue where my customer account navigation is missing from the left column in the account area.

In my customer.xml file:

<customer_account translate="label">
    <label>Customer My Account (All Pages)</label>
    <!--remove name="catalog.compare.sidebar"/>
    <remove name="sale.reorder.sidebar"/-->
    <!-- Mage_Customer -->
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
    </reference>

    <reference name="content">
        <block type="page/html_wrapper" name="my.account.wrapper" translate="label">
            <label>My Account Wrapper</label>
            <action method="setElementClass"><value>my-account</value></action>
        </block>
    </reference>

    <reference name="left">
        <block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
            <action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>
            <action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action>
            <action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action>
        </block>
        <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>
        <block type="catalog/product_compare_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
        <remove name="tags_popular"/>

    </reference>
</customer_account>

When I change <reference name="left"> to <reference name="content"> the navigation is being displayed in the content column therefore I belive it has something to do with the reference name "left" element.

In my 2column-left.phtml file I got this:

!DOCTYPE html>
<html>
<head>
    <?php echo $this->getChildHtml('head') ?>
</head>

<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>

<?php echo $this->getChildHtml('after_body_start') ?>
<?php echo $this->getChildHtml('header') ?>

<div class="container b30 t30">
    <?php echo $this->getChildHtml('global_notices') ?>
    <?php echo $this->getChildHtml('breadcrumbs') ?>

    <div class="row">
        <aside class="col-md-3">
        <?php echo $this->getChildHtml('left') ?>
        </aside>
        <div class="col-md-9">
            <?php

                $yourUrlKey = 'tpd';
                $yourUrlKey2 = 'tdp-faq';
                $cmsPageUrlKey = Mage::getSingleton('cms/page')->getIdentifier();

                if($yourUrlKey == $cmsPageUrlKey || $yourUrlKey2 == $cmsPageUrlKey) { ?>

                    <div class="three-buttons mB20">
                        <a class="button green mR20" href="/safety-data/">Safety Data</a> <a class="button green mR20 tpd" href="/tpd/">TOBACCO PRODUCTS DIRECTIVE</a> <a class="button green mR20 faq" href="/tdp-faq/">FAQs</a> <a class="button green" target="_blank" href="https://www.vampirevape.co.uk/new_order_form.xlsx">Download Our Order Form</a>
                    </div>

                <?php } ?>
            <?php echo $this->getChildHtml('global_messages') ?>
            <?php echo $this->getChildHtml('content') ?>

        </div>
    </div>
</div>

<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
<?php echo $this->getAbsoluteFooter() ?>

2

As you got solution But I want to give some suggestion,

As you found that issue with <remove name="left"/>

because this thing remove from default handler,

If you remove something in default handler then it will never get loaded again by any other handler.

If you remove any block from handler then you cannot re load that block

If you want to load it again that block in that particular block then always use unset.

And specially if you are developing an extension then don't use remove always use unset as a best practice

  • 1
    Yes, great advice. Whoever have developed the module, included the <remove name="left"> in the default handler so whatever I have tried didn't work as it was simply deleted and couldn't find where it was. I have used unset instead of remove now. Thanks for advice. – Greg May 2 '17 at 13:48
  • You are always welcome @GrzegorzWisniewski :) – Murtuza Zabuawala May 2 '17 at 14:16
0

Finally i found what the problem was. I only took over from someone else and only getting my head around the system.

The problem was, there was a

<layout version="1.0">
<default><remove name="left"/></default>

element in one of the custom modules written by someone. Removing the

<remove name="left"/>

fixed my problem.

0

Please follow the below screenshot

enter image description here

I think you might be miss the "addBodyClass" method in 'customer.xml'

    <reference name="root">
            <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
            <action method="addBodyClass"><class>customer-account</class></action>
   <reference>

Please do the changes accordingly and remove the cache session after modify the layout file.

  • Hi there! I did exactly what you have mentioned but this has not solve the issue. Any other suggestions? – Greg Apr 28 '17 at 12:54
  • ok please comment the code in between the div i.e <div class="col-md-9"> and check the same. screenshot: prntscr.com/f1uhvw – Nagaraju Kasa Apr 28 '17 at 13:06
  • Deleted <?php $yourUrlKey = 'tpd'; $yourUrlKey2 = 'tdp-faq';$cmsPageUrlKey = Mage::getSingleton('cms/page')->getIdentifier();if($yourUrlKey == $cmsPageUrlKey || $yourUrlKey2 == $cmsPageUrlKey) { ?><div class="three-buttons mB20"> <a class="button green mR20" href="/safety-data/">Safety Data</a> <a class="button green mR20 tpd" href="/tpd/">TOBACCO PRODUCTS DIRECTIVE</a> <a class="button green mR20 faq" href="/tdp-faq/">FAQs</a> <a class="button green" target="_blank" ref="vampirevape.co.uk/new_order_form.xlsx">Download Our Order Form</a></div> <?php } ?> – Greg Apr 28 '17 at 13:20
  • Only left <?php echo $this->getChildHtml('global_messages') ?> <?php echo $this->getChildHtml('content') ?> in the <div class="col-md-9"> but it has not solve the problem – Greg Apr 28 '17 at 13:21

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.