2

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

2 Answers 2

2

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')?>
2

try with direct block calling method

<?php
          echo $this->getLayout()
          ->createBlock('checkout/cart_sidebar')
          ->setTemplate('checkout/cart/sidebar.phtml')
          ->toHtml(); ?>
0

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.