Showing posts with label empty. Show all posts
Showing posts with label empty. Show all posts

Tuesday, September 20, 2011

How to hide shopping cart sidebar when it is empty?

Displaying the shopping cart when the user has nothing in it is not necessary. To hide the cart in the sidebar, try the following steps.
Step 1: Edit your "/template/checkout/cart/sidebar.phtml" and look for line
<div class="box base-mini mini-cart"> 
Step 2: Add these lines before the opening div tag
<?php $_cartQty1 = $this->getSummaryCount() ?>
<?php if ($_cartQty1 >0): ?>
Step 3: Add this line to the bottom of the file
<?php endif ?> 
Thats it. You are done.

Monday, September 12, 2011

Configurable products options are empty after moving my cart side bar to header?

I have explained Moving Cart from Right Sidebar to Header in this tutorial. After moving my cart to header I have noticed configurable options are not shown up in header. To display configurable product options do the following.

Edit your "template/checkout/cart/sidebar/default.phtml" file.
Find the line if ($_options = $this->getOptionList()):

Replace with the following
$_product = Mage::getModel('catalog/product')->load($this->getProduct()->getId());
$config = new Mage_Catalog_Helper_Product_Configuration();  
if ($_options = $config->getConfigurableOptions($_item)): 
Thats it. You are done.