How to show discounted price in automatics discount dawn theme

How to show discounted price in automatics discount dawn theme

מלבושים
New Member
20 0 0

Hi, I saw some questions about  this subject but none of them was solved.

i want to do a % discount, and i want the price of the discounted products to be updated with the price after discount, like the compere at price but I can't go through all the products to do it manually.

Is there a way to do it?

Thanks in advance!

Replies 5 (5)

oscprofessional
Shopify Partner
16115 2409 3123

Hello @מלבושים ,

To display automatic discounts on your Shopify store using the Dawn theme. Here's a combined approach that incorporates the best aspects of previous suggestions and addresses potential issues:

Method 1: Using Shopify's Built-in Discount Functionality (Recommended for Most Users)

  1. Create an Automatic Discount:

    • Go to your Shopify admin panel.
    • Navigate to Discounts > Create discount.
    • Set up your discount details:
      • Choose a discount type (percentage or fixed amount).
      • Enter the discount value.
      • Define the discount conditions (e.g., minimum order value, specific products or collections).
    • Click Save.
  2. Verify Discount Application:

    • Add a product to your cart that meets the discount criteria.
    • Proceed to checkout and ensure the discount is automatically applied.

Method 2: Code-Based Approach (For More Customization or Complex Discounts)

Important Note: This method requires editing your theme code. It's recommended to duplicate your theme before making changes and to have basic coding familiarity. If you're not comfortable with code, consider hiring a Shopify expert or using a Shopify App (see Method 3).

  1. Access Theme Code:

    • Go to your Shopify admin panel.
    • Navigate to Online Store > Themes.
    • Click Actions > Duplicate next to your Dawn theme (to avoid modifying the live theme).
    • Click Actions > Edit code.
  2. Modify the price.liquid File:

    • In the theme code editor, locate the price.liquid file (usually under Sections).

Find the code snippet that displays the product price. It might look similar to this:

 

 

<span class="price">{{ product.price | money_format }}</span>

 

 

  • Replace the above code with the following:

 

 

{% if product.compare_at_price > product.price %}
  <span class="price original">{{ product.compare_at_price | money_format }}</span>
  <span class="price">{{ product.price | money_format }}</span>
{% else %}
  <span class="price">{{ product.price | money_format }}</span>
  {% if active_discounts %}
    <span class="price-discount">You save {{ active_discounts.first.amount | money_format }}</span>
  {% endif %}
{% endif %}
​

 

 

 

    • This code checks if a discount is active and displays the discounted price along with the original price (if available). You can customize the CSS classes (original, price, price-discount) to style the discount information.
  1. Save Changes:

    • Click Save.

Method 3: Using a Shopify App (For Easier Management)

Several Shopify apps can help you manage automatic discounts and display them on your product pages. These apps often offer a more user-friendly interface and additional features compared to code editing. Here are some popular options to consider:

  • Automatic Discounts by Booster Apps
  • Discounts by POWr
  • Discount Automations by Automizy

Additional Considerations:

  • If you use multiple automatic discounts, test your store thoroughly to ensure they stack correctly.
  • Consider using a discount announcement bar or banner to highlight your promotions alongside the automatic price updates.

By following these steps, you can effectively display automatic discounts on your Shopify store using the Dawn theme, enhancing the user experience and potentially increasing sales.

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: [email protected] | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free
tobebuilds
Shopify Partner
447 32 120

@oscprofessional wrote:

Method 3: Using a Shopify App (For Easier Management)

Several Shopify apps can help you manage automatic discounts and display them on your product pages. These apps often offer a more user-friendly interface and additional features compared to code editing. Here are some popular options to consider:

  • Automatic Discounts by Booster Apps
  • Discounts by POWr
  • Discount Automations by Automizy

  1. Booster Apps does not have an "Automatic Discounts" app.
  2. POWR.io doesn't have a "Discounts" app. They do have a "Sales Pop Up" app, but that's different from automatic discounts.
  3. There is no "Discount Automations" app in the App Store, and Automizy (an email marketing automation software) has no Shopify integration.
Founder, Regios Discounts app (4.9 stars, 58 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer
מלבושים
New Member
20 0 0

Hi, thanks for replying.

I can't find the code you told me to replace. adding my price.liquid file here:

 

{% comment %}
Renders a list of product's price (regular, sale)

Accepts:
- product: {Object} Product Liquid object (optional)
- use_variant: {Boolean} Renders selected or first variant price instead of overall product pricing (optional)
- show_badges: {Boolean} Renders 'Sale' and 'Sold Out' tags if the product matches the condition (optional)
- price_class: {String} Adds a price class to the price element (optional)
- show_compare_at_price: {Boolean} Renders the compare at price if the product matches the condition (optional)

Usage:
{% render 'price', product: product %}
{% endcomment %}
{%- liquid
if use_variant
assign target = product.selected_or_first_available_variant
else
assign target = product
endif

assign compare_at_price = target.compare_at_price
assign price = target.price | default: 1999
assign price_min = product.price_min
assign price_max = product.price_max
assign available = target.available | default: false
assign money_price = price | money
assign money_price_min = price_min | money
assign money_price_max = price_max | money
if settings.currency_code_enabled
assign money_price = price | money_with_currency
assign money_price_min = price_min | money_with_currency
assign money_price_max = price_max | money_with_currency
endif

if target == product and product.price_varies
assign money_price = 'products.product.price.from_price_html' | t: price: money_price
endif
-%}

<div
class="
price
{%- if price_class %} {{ price_class }}{% endif -%}
{%- if available == false %} price--sold-out{% endif -%}
{%- if compare_at_price > price and product.quantity_price_breaks_configured? != true %} price--on-sale{% endif -%}
{%- if compare_at_price > price and product.quantity_price_breaks_configured? %} volume-pricing--sale-badge{% endif -%}
{%- if product.price_varies == false and product.compare_at_price_varies %} price--no-compare{% endif -%}
{%- if show_badges %} price--show-badge{% endif -%}
"
>
<div class="price__container">
{%- comment -%}
Explanation of description list:
- div.price__regular: Displayed when there are no variants on sale
- div.price__sale: Displayed when a variant is a sale
{%- endcomment -%}
<div class="price__regular">
{%- if product.quantity_price_breaks_configured? -%}
{%- if show_compare_at_price and compare_at_price -%}
{%- 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 variant-item__old-price">
{% if settings.currency_code_enabled %}
{{ compare_at_price | money_with_currency }}
{% else %}
{{ compare_at_price | money }}
{% endif %}
</s>
</span>
{%- endunless -%}
{%- endif -%}
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.price.regular_price' | t }}</span>
<span class="price-item price-item--regular">
{{- 'products.product.volume_pricing.price_range' | t: minimum: money_price_min, maximum: money_price_max -}}
</span>
{%- else -%}
<span class="visually-hidden visually-hidden--inline">{{ 'products.product.price.regular_price' | t }}</span>
<span class="price-item price-item--regular">
{{ money_price }}
</span>
{%- endif -%}
</div>
<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>
<small class="unit-price caption{% if product.selected_or_first_available_variant.unit_price_measurement == nil %} hidden{% endif %}">
<span class="visually-hidden">{{ 'products.product.price.unit_price' | t }}</span>
<span class="price-item price-item--last">
<span>{{- product.selected_or_first_available_variant.unit_price | money -}}</span>
<span aria-hidden="true">/</span>
<span class="visually-hidden">&nbsp;{{ 'accessibility.unit_price_separator' | t }}&nbsp;</span>
<span>
{%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%}
{{- product.selected_or_first_available_variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}
</span>
</span>
</small>
</div>
{%- if show_badges -%}
<span class="badge price__badge-sale color-{{ settings.sale_badge_color_scheme }}">
{{ 'products.product.on_sale' | t }}
</span>

<span class="badge price__badge-sold-out color-{{ settings.sold_out_badge_color_scheme }}">
{{ 'products.product.sold_out' | t }}
</span>
{%- endif -%}
</div>

tobebuilds
Shopify Partner
447 32 120

Hi מלבושים,

 

If you would like to show automatically discounted prices on product pages, then you can use our app, Regios Automatic Discounts.

 

Every theme can use our "Discounted Price" app block to automatically apply discounts on product pages.

 

And depending on what theme you're on (or if you do custom setup), you can also integrate our app to display automatically discounted prices on collection pages, the home page, and the product recommendations section.

 

If you have any questions about this, just reply, and I'll be happy to help.

 

Best,

Tobe

Founder, Regios Discounts app (4.9 stars, 58 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer

gr_trading
Shopify Partner
1919 145 199

hi @מלבושים ,

 

To implement the same kindly refer the below code file name would be card-product.liquid for DAWN theme as file may vary depends on theme and version.

 

{%- assign difference = card_product.compare_at_price | minus: card_product.price -%}
{%- assign float_difference = difference | times: 1.0 -%}
{%- assign discount_fraction = float_difference | divided_by: card_product.compare_at_price -%}
{%- assign discount_percentage = discount_fraction | times: 100 | round -%}
{{- discount_percentage }}

To implement the same on product page and line number details request you to refer the video.

 

 

Don't forget to mark answer as solution if it helps.

For any custom development WhatsApp or connect at Email ID: [email protected] for quick consultation. | Shopify Free codes
To support Buy Me a Coffee