Limit discount maximum dollar amount?

Solved
Shopify Staff
Shopify Staff
777 70 103

Hey, @Robert_Richter-.

 

Thank you for joining the thread! I can confirm that this feature request has been submitted. However, there isn't a timeline that I can provide on that. Though it's likely not a simple code fix, I can see how important this feature is for you and many of our merchants. That being said, I'd be happy to submit a feature request on your behalf as well. If Shopify moves forward with this feature, you will be able to find it in our changelog or announcements page.

 

If you have any other questions, feel free to let me know in the thread!

 

Elias | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Tourist
3 0 4

Come on, Shopify. Everyone has been asking for better coupon features for YEARS. Why is your platform so restrictive in regards to coupons and their features/settings???

Tourist
3 0 4

As simple and standard as these coupon features are and SHOULD be included. Don't hold your breath, Robert. Many people have been requesting better coupon options for years. Shopify is great and they have an awesome platform, you have to give them that, but their coupon features are very disappointing. 

0 Likes
New Member
2 0 0

I am interested in the solution for this too. Let us know!

0 Likes
New Member
1 0 0

My company is interested in this feature too. Adding a discount maximum dollar amount is important to many businesses for promotions. Shopify, can we get an update on this feature add? 

0 Likes
New Member
1 0 0

Actually... I can't believe that... 

 

here the source code for your sw developer

 

if (productPrice <= discountMaxLimit)

(

     product_price = product_price * discount;

)

 

 

JESUS! DO SOMETHING! 

 

0 Likes
New Member
1 0 0

I  was shocked when such a big platform doesn't offer this simple feature. I was in need for same but there are no apps that do it, however, there is this one app I came across which allows you to cap the offered discount amount but it doesn't work with default checkout from Shopify you need another third-party app to support. This is quite irritating though I hope shopify release this feature soon.

 

https://apps.shopify.com/automatic-discount-rules

0 Likes
New Member
2 0 0

This feature is also very important to my company.  We have been asking for this for 3 years.   Is there a timeline for this now?  Please let us know.  Thanks!

0 Likes
New Member
1 0 0

If someone is still looking for a solution. Here's a quick code snippet which can help you. You will need Shopify script editor for this (Shopify Plus)

  • Create a coupon code with 0% discount
  • Go to Apps > Script Editor > Create script > Line Items > Blank template
  • in Ruby Source Code add this

 

if Input.cart && Input.cart.discount_code and Input.cart.discount_code.code == '<Replace With Your Discount Code>'
  if Input.cart.subtotal_price >= Money.new(cents:<Replace With Maximum Discount / (Discount Percentage/100)>00)
    max_discount = <Replace With Maximum Discount Amount>
    cart_subtotal_float = Float((Input.cart.subtotal_price.cents / 100).to_s)
    Input.cart.line_items.each do |line_item|
        if line_item.line_price.cents > 0
        line_price_float = Float((line_item.line_price.cents / 100).to_s)
        percentage = 1 - (((line_price_float / cart_subtotal_float) * max_discount) / line_price_float)
        line_item.change_line_price(line_item.line_price * percentage, message: "")
        end
    end
    elsif Input.cart.subtotal_price < Money.new(cents:<Replace With Maximum Discount Amount / (Discount Percentage/100)>00)
        Input.cart.line_items.each do |line_item|
          line_item.change_line_price(((line_item.line_price)-(line_item.line_price * (<Replace With Discount Percentage>/100))), message: "")
    end
  end
end
Output.cart = Input.cart

 

  • Replace all the <variable> with your values in line 1, 2, 3, 12, 14 (Remove < and > symbols as well). Also make sure your values are round numbers e.g 600 instead of 600.124.
  • Save and Publish

This should cap/limit the discount amount.

Thanks to Github/fnstirling for this snippet. I added some improvements and bug fixes in this script though.

0 Likes
Tourist
4 0 8

None of these apps you listed have anything to do with discount codes limits.

We need a way to make discount coupons 30% off on orders up to $1000.

Or specify the maximum amount discounted, like: 30% off with a maximum discount $300.

Having Shopify Plus and writing a custom script should NOT be a solution for a feature as basic as this.