Jump to content

Wishlist in header section


Recommended Posts

I came across this requirement where I had to show the wishlist with counter on top in my header section so I kind of used this way 

 

{if $id_customer|intval neq 0}
 
 
     
<div id="wl1" class="header-top-menu_like" style="margin-bottom: -30px; margin-left: 22%;">
                                          
 
{if $wishlists}
 
{section name=i loop=$wishlists}
                                           
{assign var=n value=0}
{foreach from=$nbProducts item=nb name=i}
{if $nb.id_wishlist eq $wishlists.id_wishlist}
{assign var=n value=$nb.nbProducts|intval}
{/if}
{/foreach}
{if $n}
 <div class="header-top-menu_noti">{$n|intval}</div>
 
{else}
0
{/if}
                                                  
 
 {/section}
 
{/if}
                          
 
</div>  
 
</a>
 
{/if}
 
 
But the issue that I m facing here is number of products in the wishlist is not seen while I m on any other page . But When I redirect it to the wishlist page, the number of products shows up ... Please check the  below attachments to understand the exact logic. 

post-1007319-0-63140300-1439797327_thumb.png

post-1007319-0-70987500-1439797365_thumb.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...