I've just discovered a problem that I don't know how to fix.
I have a setup where the product Inventory quantity controls whether or not the product can added to the cart. When the quantity reaches 0 the code delivers a Sold Out black banner and does not display the Add to Cart mechanism. In my testing this was working. Here is the code managing this:
{% if this['Inventory Quantity'] == 0 %
<h2 class="inventory-0">Sold Out</h2>
{% else %}
Display add to cart
{% endif %}
I have just run some tests involving purchases of an item that had quantity = 1, so that after the purchase the Inventory Quantity shows as 0 and I was expecting to see the product detail turn off the Add to Cart elements and display the Out of Stock banner. This did not happen. I thought maybe there was a time lag but after half an hour and refreshing the browser the update still had not kicked in.
Only after disabling the product and then enabling it again id the product update. So this is not working.
This is a bit of a concern to me. Have I found a bug or have I missed something in my customization of the code managing the elements concerned? The attached images help explain what is/isn't going on.
First image shows what should be happening.

This image shows what is happening after Inventory Quantity reaches 0

Appreciate any help with this.
Cheers
Grant