Automatically refresh page when selecting/changing a variant [Debut Theme]

nwcoeurope
Tourist
7 0 2

Hi everyone,

I have created the following availability view for our customers and if the variant is changed (if several are available) it does not change existing, only when I update the page.

Can someone help me that the inventory is automatically updated when changing the variant?

 

 

      	{% if current_variant.inventory_management == "shopify" %}
    		{% if current_variant.inventory_quantity == 0 %}
      			<p style="color: #cc8164;font-size: 10px;">Not available</p>
      		{% elsif current_variant.inventory_quantity > 5 %}
      			<p style="color: #48946e;font-size: 10px;">Available</p>
      		{% elsif current_variant.inventory_quantity < 5 %}
      			<p style="color: #cc8164;font-size: 10px;">Only {{ current_variant.inventory_quantity }} available</p>
    		{% endif %}    
		{% endif %}  

 

 

I also wanted to add another variable, if the goods are reordered (and overselling is allowed without stock), which can be displayed as an additional point. For example: If the goods have been ordered = the product is available from the "expected delivery date of the order" (or in x weeks until the expected goods receipt is).

Thank you very much in advance.

Best Regards,

Mike

0 Likes