Removing dummy products from bundle builder

mariusslo
Tourist
10 0 2

Hi guys,

So i've bothered bundle builder support enough to get info on how to potentially hide their dummy-legacy products, but now I am having a pagination issue. For those who don't know what I am talking about. Bundle builder is an app that lets users themselves create bundles from given products, and for some reason every different variation of the bundle is saved as a variation. That being said when the variations reach a 100, they duplicate the bundle leaving the old one, and TADA! now you have 2 bundles showing on the fronted which is confusing. 

That being said we can hide the legacy variation modifying the collection liquid file like so:

{%- for product in collection.products -%}
    {%- if product.tags contains 'bundle-builder-dummy-legacy' -%}
        ** do nothing **
    {%- else -%}
        ** print out product **
    {%- endif -%}
{%- endfor -%}

But now I've gotten myself in a pagination issue. Lets say my pagination limit is set to 8 product per page and as I understand Shopify grabs these 8 products in the loop, the issue here is if it is not the last page, and that page contains 2 dummy-legacy items it prints out 6 out of 8 products looking like all products have ended, but we are on page 2 out of 5. So my questions would be how to collect all products in the for loop that DO NOT contain a certain tag - in this case 'bundle-builder-dummy-legacy'.

 

0 Likes

I guess you can use the unless tag instead of if tag

{%- for product in collection.products -%}
    {%- unless product.tags contains 'bundle-builder-dummy-legacy' -%}
        ** print out product **
    {%- endunless  -%}
{%- endfor -%}

 

SPO - SEO App to research keywords & edit social link preview
BYOB - Build Your Own Bundles
0 Likes