Liquid code block not refreshing upon changing product variant in Broadcast theme

bellamadre
Visitor
1 0 0

We have a liquid code block on our product pages that is configured with a simple if/else statement to display a unique message for different inventory scenarios (i.e. In Stock - Ready to Ship, Made to Order, etc.). This block should render a new message if a certain product variant is out of stock. The code block currently works unless a product has some variants that are in stock and other variants that are out of stock.

 

For products with in and out of stock variants, the liquid block works if the user manually refreshes the page; however, assuming most people will not do that, we need the code block to automatically refresh when someone changes the product variant (i.e. size, color, etc.).

 

We are using Broadcast theme 3.7.1. 

 

For reference, this is the liquid code snippet installed in our product page template, and these are the messages that should be automatically rendering:

 

{% if product.tags contains 'Made to Order' %}
<img src="{{ 'icon-blue-circle.svg' | asset_url }}" class="icon icon-box" <p> Made-to-Order - See Shipping Details Below </p>

 

{% elsif product.tags contains 'personalized' %}
<img src="{{ 'icon-blue-circle.svg' | asset_url }}" class="icon icon-box" <p> Personalized - See Shipping Details Below </p>

 

{% elsif product.tags contains '_preorder' %}
<img src="{{ 'icon-blue-circle.svg' | asset_url }}" class="icon icon-box" <p> Pre-Order - See Shipping Details Below </p>

 

{% elsif product.selected_variant.inventory_quantity <= 0 %}
<img src="{{ 'icon-blue-circle.svg' | asset_url }}" class="icon icon-box" <p> Made-to-Order: See Shipping Details Below </p>

 

{% else %}
<img src="{{ 'icon-taupe-circle.svg' | asset_url }}" class="icon icon-box" <p> In-Stock - Ready to Ship or Pickup in Showroom! </p>

{% endif %}

Replies 0 (0)