0

I am using Magento1.9.2.4. I remove the minicart from header and insert it in customer footer phtml file, As the work of remove and insert has been done by XML.

Mini cart is working fine, the only issue is that Count on mini cart are wrong, If I disable BlockHTML cache the counts are showing accurate.

I am using Porto theme, I did the below: my theme's layout local.xml:

<default>
        <reference name="header">
          <action method="unsetChild"><name>minicart</name></action>
        </reference>

        <reference name="footer">
          <action method="insert"><block>minicart</block></action>
          <action method="setTemplate"><template>page/html/custom_footer.phtml</template></action>
       </reference>
</default>

My custom_footer.phtml file:

<li id="cart_custom" class="list-top cart cart_custom"> 
<a href="<?php echo $cart; ?>">
    <div class="cart-area">
        <?php 
        echo $this->getChildHtml('minicart'); //MiniCart
        ?>
    </div>
    <?php echo "<img src='".Mage::getBaseUrl('media').trim("icon_cart").".png'/>"; ?>
    <span><?php echo $this->__('Cart') ?></span>
</a>
</li>

Suggest how can I fix it.

  • Could you please provide a code that you did so I can have review – samumaretiya Jan 3 '18 at 6:24
  • @sagarumaretiya, Please check, I update my question. – Yogita Jan 3 '18 at 6:53
1

I've tried your local.xml code with little modification in my local machine with magento 1.9.3.4 and get it working. Please try following code

<default>
        <reference name="header">
            <action method="unsetChild"><name>minicart_head</name></action>
        </reference>
        <reference name="footer">
            <action method="unsetData"><key>cache_lifetime</key></action>
            <action method="unsetData"><key>cache_tags</key></action>
            <action method="insert"><block>minicart_head</block></action>
        </reference>
</default>

Let me know if you are still having a issue

  • its not working, still have the same issue – Yogita Jan 3 '18 at 9:01
  • Are you using any third party cache or native Magento cache system ? – samumaretiya Jan 3 '18 at 11:13
  • Could you please also make sure that your store have any file named with turpentine_esi.xml ? – samumaretiya Jan 3 '18 at 11:32
  • Yes, No such File or any extension has been used. Even If I try the same with default magento, It is having the same issue. – Yogita Jan 4 '18 at 5:01
  • You can try with <flush_events> in your local.xml. – samumaretiya Jan 4 '18 at 5:05
0

Update your custom_footer.phtml as follows.

<li id="cart_custom" class="list-top cart cart_custom"> <a href="<?php echo $cart; ?>">
<div class="cart-area">
    <?php echo $this->getChildHtml('minicart', false); //MiniCart ?>
</div>
<?php echo "<img src='".Mage::getBaseUrl('media').trim("icon_cart").".png'/>"; ?>
<span><?php echo $this->__('Cart') ?></span></a>
</li>

Clear the cache and refresh.

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.