<li class="trigger-item">
      <?php $moduleName = 'wishlist';
      $cartCount = Mage::helper('checkout/cart')->getCart()->getSummaryQty();?>
        <?php if ($this->helper('wishlist')->isAllow()) : ?>
              <a class="trigger-link-wish-list" href="<?php echo $baseUrl; ?>wishlist/">
            <span class="trigger-icon icon-heart"></span>
    <?php if ($cartCount > 0): ?>
        <span class="cart-counter">
            <?php echo $cartCount; ?>
    <?php else: ?>
        <span class="cart-counter cart-counter--zero">0</span>
    <?php endif; ?>
  <?php endif;?>

2 Answers 2


Wishlist item count is also stored in customer session.

$count = Mage::getSingleton('customer/session')->getWishlistItemCount();

For not logged in customers it's 0, so it's same as ...

 $count = 0;
 if (Mage::getSingleton('customer/session')->isLoggedIn()) {
     $count = Mage::getSingleton('customer/session')->getWishlistItemCount();

You can try this.

    $wishListCount = 0;
    if (Mage::getSingleton('customer/session')->isLoggedIn()){
        $customer = Mage::getSingleton('customer/session')->getCustomer();
        $wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer, true);
        $wishListCount = $wishlist->getItemsCount();

Now $wishListCount holds what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.