Back in Stock Button persists when in stock

We are using Klaviyo Back In Stock with Shopify. The Back In Stock button and flow work exactally as intended for products containing out of stock items.

I am looking for a solution to hide the button if all size variants are in stock. We are using UPSCALE theme.

^ In screenshot above, all sizes are in stock on this product, but is displaying Back In Stock Notification Button. There’s not even a form modal when its clicked on (as intended because all items are in stock).

^ This product contains a few out of stock size variants, the button disappears if user selects and in-stock item, as intended,

^^ If user clicks on out of stock size, then button appears, as intended.

Otherwise, the back in stock form modal works exactally as intended

I am looking for a solution to hide the “Notify me” button when ALL size variants are in stock.

Klaviyo support says contact Shopify or dev

Shopify Plus support says contact theme developer

I’m still waiting to hear back from Theme Developer.

If someone has code syntax to HIDE .Back_In_Stock-Button IF ALL IN SIZE are in stock then that would be amazing.

Actually, you need to customize the code logic for hiding or showing the “Notify me” button.
Theme Developer can solve the issue, or you can find a developer to help you solve the issue

1 Like

Thank you @JonasS

After of trial and error the theme developer provided the following to display IF variant is in stock or out of stock lookup:

{% assign all_variants_in_stock = true %}
{% for variant in product.variants %}
{% if variant.available == false %}
{% assign all_variants_in_stock = false %}
{% break %}
{% endif %}
{% endfor %}
{% if all_variants_in_stock %}

{% else %}

Notify Me When Available

.klaviyo-bis-trigger { /* display: none !important; */ }

{% endif %}