Showing price after an automatic discount directly on the product page

Shopify Partner
1 0 10

Hi there!


I wanted to test the automatic discounts for special events, for example the Summer Sales or whatever.

So the I created my automatic discount and selected the products I want to apply it on. On the cart, no problem the price displayed is the actual price minus the reduction.


Thing is, I'd like to change the price on the product page too. For the moment, the normal price is still displayed. If possible I would like to avoid setting the price manually for each variant of each product, I have a lot of them...


In fact, I'd like to have something exactly like when you I apply manually the discount in the 'Pricing' section of the product: the real price crossed and the discounted price showed. And with the sentence 'You saved $XX !" also.


I tried to modify the code by copying the code from the cart page to the product page but was unsuccessful. I can't manage to get the discounted price, the price showing is still the one before the discount.


Anyone has an idea how I can solve this ? Or an indication ?


Thanks a lot!

New Member
2 0 3

This is exacly what I'm looking for and got nothing yet on google, I hope someone could help us.

New Member
1 0 5
I’ve been looking for this! So, far I’ve asked 3 Shopify collaborators who have been no help and told me it only exists for the cart page. I feel like this is a necessity for online shops, yet Shopify lacks that major feature. I hope someone can solve this soon.
New Member
1 0 2

I have the same issues, I am not able to find anything to help

64 0 109

Looking for a solution for this as well....


Shopify....? Are you listening?

5 0 4

Same here, would love to only have 1 price list, then everything else managed by "automatic discounting"


Have requested via live chat, so will wait to hear back

New Member
2 0 8

I'm trying to do the same thing.  I had to go back to my products and change the pricing manually, and take off the automatic discount.  It was easy though with holding down shift key and clicking the bottom cell to be able to change all at once.  I agree - Shopify needs to add an option to the discount settings so that customers can see the discount reflect immediately.  

New Member
1 0 6

I can't believe this isn't available yet - all the major retailers have slashed prices (especially on Cyber Monday) and you are way more apt to add something to your cart when you see the savings. Shopify - please hurry up!

13 1 1

After much research, I also did not find a solution on the internet. The main problem is that 'line_level_discount_allocations' is only available in a for loop which traverses the 'cart' object. I tinker with a functional solution for our shop, but I warn you I am a novice:


let pvfID = {{ }},
            newVal = 1,
            discounts= [],
            discountAllocation = function (type, title, value, valueType, allocationMethod, targetSelection, targetType, totalAllocatedAmount) {
              this.type = type;
              this.title = title;
              this.value = value;
              this.valueType = valueType;
              this.allocationMethod = allocationMethod;
              this.targetSelection = targetSelection;
              this.targetType = targetType;
              this.totalAllocatedAmount = totalAllocatedAmount;
            pvfIDPOST = function() {
    '/cart/add.js', {quantity: 1, id: pvfID})
            pvfIDREMOVE = function(newQty){
    '/cart/change.js', {quantity: newQty, id: pvfID})
        $.when( pvfIDPOST() ).done(setTimeout (function() {        	
            jQuery.getJSON('/cart.js', function(cart) {      
              for(let i = 0; i < cart.items.length; i++){
                if(pvfID === cart.items[i].id){
                    let currentQty = cart.items[i].quantity;
                    if(cart.items[i].line_level_discount_allocations.length > 0){
                      for(let it = 0; it < cart.items[i].line_level_discount_allocations.length; it++){
                        let currentItem = cart.items[i].line_level_discount_allocations[it].discount_application;                        
                        discounts[it] = new discountAllocation(currentItem.type, currentItem.title, currentItem.value, currentItem.value_type, currentItem.allocation_method, currentItem.target_selection, currentItem.target_type, currentItem.total_allocated_amount);                                                
					  console.log('discount allocations not fount');
			Shopify.getCart(function(data){ console.log(data); })
        }, 2000 ));
        function showDiscount(){
          for(let i = 0; i < discounts.length; i++){

This javascript code uses the jquery library. it uses the shopify API to add the product from the product page consulted in the cart, extracts the automatic promotion and finally it removes the product from the cart. The content of the automatic promotion will be visible in the console. You still have to modify the current code to display the information that interests you on your template.

New Member
2 0 1

did you found already a solution?