Product Count For Each Collection/Subcategory Not Showing In Sidebar Menu

New Member
2 0 0

unable to display the collection count for the 3 layers of my sidebar .EG: Womens Fashion(328) - Tops & Sets(134) - Hoodies, Cardigans & Sweatshirts(83)

I Have been trying to fix this for days,I would really appreciate some help on this.Store URL: www.dealsnsteals.shop, Please see the Below " sidebar-category.liquid " Code 

<div class="block block-category spaceBlock">
  {% if settings.sidebar_categories_title != blank %}
  <h3 class="block-title">
    {{ settings.sidebar_categories_title }}
  </h3>
  {% endif %}
  <div class="widget-content">  
      <ul class="toggle-menu list-menu">     
        {% for link in linklists[settings.categories_menu].links %}       
        {% assign child_list_handle = link.title | handleize %}

        {% if linklists[child_list_handle].links != blank %}
        <li class="{% if link.active %}active{% endif %} toggle-content">

          <a href="{{ link.url }}">{{ link.title | capitalize }}<span class="count">{% if collections[child_list_handle].title !="" %}( {{collections[child_list_handle].products_count}} ){% endif %}</span><span class="caret"><i class="fa fa-angle-down"></i></span></a>
          <ul class="sub-menu level-1">
            {% for childlink in linklists[child_list_handle].links %}
            {% assign child2_list_handle = childlink.title | handleize %}      
            {% if linklists[child2_list_handle].links != blank %}

            <li {% if childlink.active %} class="active"{% endif %}>
              <a href="{{ childlink.url }}" >{{ childlink.title | capitalize }}<span class="count">{% if collections[child2_list_handle].title !="" %}( {{collections[child2_list_handle].products_count}} ){% endif %}</span><span class="caret"><i class="fa fa-angle-down"></i></span></a>              
              <ul class="sub-menu level-2">
                {% for childlink2 in linklists[child2_list_handle].links %}
                <li{% if childlink2.active %} class="active"{% endif %}>  
                  <a href="{{ childlink2.url }}">{{ childlink2.title | capitalize }}<span class="count">{% if collections[childlink2.title].title !="" %}( {{collections[childlink2.title].products_count}} ){% endif %}</span></a>
                </li>
                {% endfor %}
              </ul>            
            </li>
            {% else %}

            <li {% if childlink.active %} class="active"{% endif %}>
              <a href="{{ childlink.url }}" >{{ childlink.title | capitalize }}<span class="count">{% if collections[child2_list_handle].title !="" %}( {{collections[child2_list_handle].products_count}} ){% endif %}</span></a>              
            </li>
            {% endif %}
            {% endfor %}
          </ul>
        </li>    
        {% else %}

        <li {% if link.active %} class="active"{% endif %}>

          <a href="{{ link.url }}">{{ link.title | capitalize }}<span class="count">{% if collections[child_list_handle].title !="" %}( {{collections[child_list_handle].products_count}} ){% endif %}</span></a>
        </li>
        {% endif %}
        {% endfor %}      
      </ul>  
  </div>
</div>
0 Likes