Magento 1.9 – How to Call ‘sidebar.phtml’ in Cart Pop Up

magento-1.9sidebar

I am using magento 1.9.2.3. In my header.phtml when I call the cart sidebar like

<?php echo $this->getChildHtml('cart_sidebar'); ?>

the sidebar is not getting displayed when hovered over the cart icon. Also I enabled it in backend.

Below is my cart. Kindly help me to enable the sidebar.

enter image description here

Best Answer

I have one more alternative to perform this task. Please follow below steps:

  1. Go to you theme folder i.e

app/design/frontend/your_package/your_theme/layout/page.xml

Find the code given below:

<block type="page/html_header" as="header">

And past the cart sidebar block shown below:

<block name="header" as="header">     
<block name="top.links" as="topLinks"/>     
<block name="store_language" as="store_language" template="page/switch/languages.phtml"/>     
<block name="top.menu" as="topMenu"/>     
<!--Add cart sidebar block -->     
<block name="cart_sidebar" as="headerCart" template="checkout/cart/sidebar.phtml"/>     
</block>

2. : And now, in template file header.phtml

(app/design/frontend/your_package/your_theme/template/page/html/header.phtml),

call cart sidebar block as a child in header

<?php echo $this->getChildHtml('headerCart')?>
Related Topic