Hide the header cart in opencart 1.5.2.1

Posted by Flo on 05 May 2012

In case you only display prices only if the customer is logged in , this modification is a must.

By default, even if the prices arent displayed for the unlogged customers, they become visible if the visitor adds them to cart.

Make this modification only if the above case applies to you, and the header cart will be hidden until the customer logs in.

Edit the file catalog/view/theme/yourtheme/template/common/header.tpl and find the line:

<?php echo $cart; ?>

and replace it with:

<?php if ($logged) { ?>
<?php echo $cart; ?>
<?php } ?>