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

Topic summary

A Liquid code block on product pages displays inventory status messages (In Stock, Made to Order, Pre-Order, etc.) based on variant availability. The block uses if/else statements to check product tags and selected variant inventory.

Core Issue:
The code block fails to update automatically when users switch between product variants—particularly problematic for products with mixed stock levels (some variants in stock, others out of stock).

Current Behavior:

  • Works correctly on initial page load
  • Updates only when users manually refresh the page
  • Does not respond to variant selection changes

Required Solution:
The code block needs to automatically refresh/re-render when customers change product options (size, color, etc.) without requiring a manual page refresh.

Technical Context:

  • Theme: Broadcast 3.7.1
  • Implementation: Liquid code snippet in product page template
  • Messages displayed based on: product tags (‘Made to Order’, ‘personalized’, ‘preorder_’) and selected variant inventory quantity
Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

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”

Made-to-Order - See Shipping Details Below

{% elsif product.tags contains ‘personalized’ %}
<img src=“{{ ‘icon-blue-circle.svg’ | asset_url }}” class=“icon icon-box”

Personalized - See Shipping Details Below

{% elsif product.tags contains ‘_preorder’ %}
<img src=“{{ ‘icon-blue-circle.svg’ | asset_url }}” class=“icon icon-box”

Pre-Order - See Shipping Details Below

{% elsif product.selected_variant.inventory_quantity <= 0 %}
<img src=“{{ ‘icon-blue-circle.svg’ | asset_url }}” class=“icon icon-box”

Made-to-Order: See Shipping Details Below

{% else %}
<img src=“{{ ‘icon-taupe-circle.svg’ | asset_url }}” class=“icon icon-box”

In-Stock - Ready to Ship or Pickup in Showroom!

{% endif %}