Discussions

Discount on Amount in Cart

I have been trying to set up a discount based on the amount a customer spends.

If the customer spends $70 or more they get 10% off
or if they spend $100 they get 12% and so on....

But I have been unable to get this to work via rules. I tried to set a rule as such

for $70 or more I tried to set it up this way

After adding a product to cart

Data comparison
Parameter: Data to compare: [commerce-order:commerce-order-total:amount Operator: is greater than, Data value: 6900

Data comparison
Parameter: Data to compare: [commerce-order:commerce-order-total:amount Operator: is less than, Data value: 10000

Calculate a value
commerce-order:commerce-order-total:amount
Operator (*) Data value .9

It didn't work. I also tried before saving an order, but that didn't work either. Could anyone help?

Posted: Nov 13, 2011

Comments

Prince Manfred on November 13, 2011

You probably want to use the event "Calculating the sale price of a product," add the data comparison conditions to that, and then use the action "Multiply the unit price by some amount." This will take the percentage off of each product which will give the same effect as taking it off the total. If you use the price component type "discount" it should show a nice little line item before the total that shows the total amount of discount they are getting.

I'm not sure of a way to discount the order total directly with rules, but this method should work fine.

Prince Manfred on November 13, 2011

Here's a tip: If you don't want the user to see the discount except in the cart you can go to "manage display" for your product type and change the display settings for price to "Display the original price as loaded."

:D

daobydesign on December 28, 2011

This works great for not showing the discount on listing and individual product display pages, however, what if you don't want to show the discounted amounts in the cart/checkout line items either? I think it's a bit confusing for a user to add items to their cart at one price, but then it shows up as another price on the /cart/ page.

Likewise, on the checkout page it shows the discounted amounts, a subtotal that doesn't add up to the amounts above it, then the discount, then the actual total. The subtotal, discount and total lines make sense, but the discounted prices in the line items throws off the UX.

Is there a way to set cart and checkout items to also display the "original price as loaded" too?

rfay Randy Fay on December 28, 2011

The cart and checkout views are views, so you can create a relationship on the product in the cart view and add a field for the price (from the product) and display it as "original price".

Sean on November 17, 2011

That is what I've done as well using Prince Manfred's module http://drupal.org/project/commerce_conditions (thanks again Prince for your help there.)

Don't forget to put in two conditions per discount such as Order Total >= $70 and then another for Order Total < $100. Or else when you create the discount for $100 they will stack on top of each other and you will get 10% off the total order and then once they get up to $100 they will get 12% off the total again, that has already got 10%.

daobydesign on December 1, 2011

I can see how the above would work for percentage-based discounts, but what if you just want a flat dollar amount discount?

For example, if an order total is > $150, give a $20 discount?

Any assistance is much appreciated.

rtdean93 on June 26, 2012

I am trying to add a dollar amount discount. Did you ever find a solution?

Sean on July 24, 2012

Honestly it's been about six months since I've done anything to alter my Commerce site. Maybe the other poster did something like this but I never tried. You can also post in the module issue queue I posted above and see if it's possible with that. Sorry.