Sold Out Form - Need Refresh to show in Variants

Hello,

I have made a form to show when product is out of stock and that is working when i have no variants.

When i have variants like color or size, and one of the variant is out of stock just show the text “SOLD OUT” and the form is not displayed, and if i make refresh to the page the form is showed.

The shopify url is Maballa.com

Product with NO variants

https://maballa.com/products/macacao-cat

Product with Variants some with Stock and others don’t

https://maballa.com/products/vestido-ariel

I have created in assets the file called “sold-out-form.liquid” with the following code


  {% form 'contact' %}
    {% if form.posted_successfully? %}
    

Obrigado! Iremos notificá-lo quando este produto estiver disponível! 

    {% else %}
    ### Seja o primeiro a saber quando {{ product.title }} torna-se disponível. 
    {% endif %}
    {% if form.errors %}
    
      

Por favor, forneça um endereço de e-mail válido

    

    {% endif %}
    {% unless form.posted_successfully? %}
      {% if customer %}
      
      {% else %} 

      

  {% endif %}
      
      

    {% endunless %}
  {% endform %}

 

and in the main-product.liquid called the form

{% include 'sold-out-form' %}

What i need to solve this?

Best Regards,