Shopify Supply theme sale price show wrong when product has not default variant

Shopify Supply theme sale price show wrong when product has not default variant

theme/sections/product-template.liquid

{% if product.compare_at_price_max > product.price and section.settings.product_show_saved_amount %}
            
            - {% assign compare_price = variant.compare_at_price %}
                  {% assign product_price = variant.price %}
                  {% include 'price-sale' %}
              
          
                 {% endif %}
            
            

            {% endif %}

don’t show the correct sale price.

here is solution

{% if product.compare_at_price_max > product.price and section.settings.product_show_saved_amount %}
            
            - {% if product.price_varies  %} 
              
                  {% assign compare_price = variant.compare_at_price %}
                  {% assign product_price = variant.price %}
                  {% include 'price-sale' %}
              
                {% else %}
              
                {% assign compare_price = product.compare_at_price %}
                {% assign product_price = product.price %}
                  {% include 'price-sale' %}
              
                 {% endif %}
            
            

            {% endif %}