B-219 Sec-55 Noida, India
+918010221733

How to hide shopping cart sidebar when it is empty

Here is how you could hide the shopping cart side bar when it is empty:
1. Open: app/design/frontend/default/<your template>/template/checkout/cart/sidebar.phtml
2. Go to line 32 Look for

<div class="box base-mini mini-cart">

3. Add these lines right before that opening div tag

<?php $_cartQty = $this->getSummaryCount() ?>
<?php if ($_cartQty >0): ?>

4.Add this line to the bottom of the file

<?php endif ?>

That is it your are all set, the shopping cart will only show if user adds items to their shopping cart.

(Visited 254 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.