Don’t have any good answer for you but do you really need this “{% if variant.inventory_policy == “deny” %}”. It seems abundant and possible to cause issues?
There should only be “deny” and “continue” but if I remember correctly, there are people that got that it was undefined.
Also I realise this only matter if you get it to work but regarding that else statement. Do you
really want the customer to get to the variant that is sold out
Thanks for your input about the “deny” that is how it was before and it is working so is good for us. For the second one yes it is important to have variants without stock because we have another implementation that customer can get an email when restocked.