New Shopify Certification now available: Liquid Storefronts for Theme Developers

Appearance of the price on the theme dawn 11

manurun
Excursionist
19 0 4

Hello everyone,
Could someone please tell me how to reverse the promotion price and the regular price on the dawn 11 theme?
Thanks for your help !

 

Capture.PNG

Reply 1 (1)
Adenan
Tourist
9 2 2

Hey ^^,

Try this:

!! You have to edit the code of your theme, so make a copy of your theme before edit !!

 

  1. Go in your "price.liquid" file (in "snippets" folder).
  2. Search the element (use ctrl + f to search a text):
    <div class="price__sale">
REPLACE THIS CODE:

<div class="price__sale">
      {%- unless product.price_varies == false and product.compare_at_price_varies %}
        <span class="visually-hidden visually-hidden--inline">{{ 'products.product.price.regular_price' | t }}</span>
        <span>
          <s class="price-item price-item--regular">
            {% if settings.currency_code_enabled %}
              {{ compare_at_price | money_with_currency }}
            {% else %}
              {{ compare_at_price | money }}
            {% endif %}
          </s>
        </span>
      {%- endunless -%}
      <span class="visually-hidden visually-hidden--inline">{{ 'products.product.price.sale_price' | t }}</span>
      <span class="price-item price-item--sale price-item--last">
        {{ money_price }}
      </span>
</div>

 

With this code:

 

<!-- CUSTOM SALE PRICE -->
<div class="price__sale">
      <span class="visually-hidden visually-hidden--inline">{{ 'products.product.price.sale_price' | t }}</span>
      <span class="price-item price-item--sale price-item--last">
        {{ money_price }}
      </span>

    {%- unless product.price_varies == false and product.compare_at_price_varies %}
        <span class="visually-hidden visually-hidden--inline">{{ 'products.product.price.regular_price' | t }}</span>
        <span>
          <s class="price-item price-item--regular">
            {% if settings.currency_code_enabled %}
              {{ compare_at_price | money_with_currency }}
            {% else %}
              {{ compare_at_price | money }}
            {% endif %}
          </s>
        </span>
    {%- endunless -%}
</div>

 

 

If that doesn't work, please send me the link of your shop, so I can give you a more precise solution 🙂

Adenan K.
Helping with your technical queries! If I've assisted you, consider buying me a little espresso (click here ✌️) to support my efforts.
Happy coding!