Product Count

Highlighted
Shopify Partner
1 0 0

I have a "Brands" menu in the header which is supposed to only show brands which have live products listed on the site for that particular brand. It is basing this on a list of collections, one for each brand. It cycles through each collection and uses all_products_count  to decide whether or not to show the brand. the the line of code which decides of a collection has products is:

{% assign productsCount = child_collection.all_products_count | plus: 0 %}

The issue we are having, is that the product count is blank at times. there is simply no value and those brands are not being listed in the header menu. however, they do have products listed in the collection which are live.

0 Likes