Have your say in Community Polls: What was/is your greatest motivation to start your own business?

How can I display savings and sale prices on my Dawn theme cart page?

Solved

How can I display savings and sale prices on my Dawn theme cart page?

Nijat123
Tourist
14 0 3

Hello all, 
I wan to add regular price, sale price and how much customers saved for the product to cart items in Shopify cart Page. How can I add it in Shopify to my cart page. I use dawn theme

Accepted Solution (1)

BSS-Commerce
Shopify Partner
3477 463 547

This is an accepted solution.

Hi @Nijat123 

To accomplish the above requirements, you need to change the liquid file of the store. You can follow the steps below:

- Go to Online Store > Theme > Edit code

view - 2023-02-07T133046.731.png

- Then search for "cart" in the search box => find the file main_cart_items.liquid => find line 87:

view - 2023-02-07T133238.489.png

- Make changes to the code: Find the code in the main_cart_items.liquid file found above.

view - 2023-02-07T133328.239.png

- And replace them with the code below:

view - 2023-02-07T133340.821.png

                    {%- if item.original_price != item.final_price -%}
                      <div>
                        <div>
                          <span>
                            {{ 'products.product.price.regular_price' | t }}
                          </span>
                          <s class="cart-item__old-price product-option">
                            {{- item.original_price | money -}}
                          </s>
                        </div>
                        <div>
                          <span>
                          {{ 'products.product.price.sale_price' | t }}
                          </span>
                          <strong class="cart-item__final-price product-option">
                            {{ item.final_price | money }}
                          </strong>
                        </div>
                        <div>
                          Price saved {{ item.original_price | minus: item.final_price | money}}
                        </div>
                      </div>
                    {%- else -%}
                      <div>
                         {% if item.product.compare_at_price %}
                          <div>
                           Regular price <s class="cart-item__old-price product-option"> 
                           {{item.product.compare_at_price | money }}
                           </s>
                          </div>
                        {% endif %}
                      
                        Sale price
                        <strong class="cart-item__final-price product-option">
                          {{ item.original_price | money }}
                        </strong>
                      
                        {% if item.product.compare_at_price %}
                         <div>
                              Price saved 
                           {{ item.product.compare_at_price | minus: item.original_price | money}}
                          </div>
                        {% endif %}
                      </div>
                    {%- endif -%}

Save your code and check the result. Here are the result that we have done:

view - 2023-02-07T133450.092.png

I hope that it will work for you.

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .


B2B Solution & Custom Pricing | Product Labels by BSS


Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency

View solution in original post

Replies 3 (3)

BSS-Commerce
Shopify Partner
3477 463 547

This is an accepted solution.

Hi @Nijat123 

To accomplish the above requirements, you need to change the liquid file of the store. You can follow the steps below:

- Go to Online Store > Theme > Edit code

view - 2023-02-07T133046.731.png

- Then search for "cart" in the search box => find the file main_cart_items.liquid => find line 87:

view - 2023-02-07T133238.489.png

- Make changes to the code: Find the code in the main_cart_items.liquid file found above.

view - 2023-02-07T133328.239.png

- And replace them with the code below:

view - 2023-02-07T133340.821.png

                    {%- if item.original_price != item.final_price -%}
                      <div>
                        <div>
                          <span>
                            {{ 'products.product.price.regular_price' | t }}
                          </span>
                          <s class="cart-item__old-price product-option">
                            {{- item.original_price | money -}}
                          </s>
                        </div>
                        <div>
                          <span>
                          {{ 'products.product.price.sale_price' | t }}
                          </span>
                          <strong class="cart-item__final-price product-option">
                            {{ item.final_price | money }}
                          </strong>
                        </div>
                        <div>
                          Price saved {{ item.original_price | minus: item.final_price | money}}
                        </div>
                      </div>
                    {%- else -%}
                      <div>
                         {% if item.product.compare_at_price %}
                          <div>
                           Regular price <s class="cart-item__old-price product-option"> 
                           {{item.product.compare_at_price | money }}
                           </s>
                          </div>
                        {% endif %}
                      
                        Sale price
                        <strong class="cart-item__final-price product-option">
                          {{ item.original_price | money }}
                        </strong>
                      
                        {% if item.product.compare_at_price %}
                         <div>
                              Price saved 
                           {{ item.product.compare_at_price | minus: item.original_price | money}}
                          </div>
                        {% endif %}
                      </div>
                    {%- endif -%}

Save your code and check the result. Here are the result that we have done:

view - 2023-02-07T133450.092.png

I hope that it will work for you.

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .


B2B Solution & Custom Pricing | Product Labels by BSS


Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency
Nijat123
Tourist
14 0 3

Thank you for your reply, it worked. great

amyp25
Excursionist
15 1 13

Worked perfect for me too, thanks so much!