Discussions

Discount on total based on quantity?

I've hunted around the forums and the issue queue, but haven't found an answer to the following:

I need to create a discount that works as follows:

If total cart quantity is > X, subtract $Y from the cart total.

So, for example, if the quantity in the cart is > 1, -$5 from the cart total.

I've been through all the examples in the documentation (and great videos by Randy), but they all seem to centre around a percentage-based discount on each line item. I'm not interested in a line-by-line discount, only a total.

It would also be important to display this in the order summary, like:

Product Number 1 - $10
Product Number 2 - $15
_______________________
Discount: -$5
Total: $20

This seems like it would be a fairly straight-forward task for rules, but I can't seem to find the magic combination to make it work. Any help is extremely appreciated.

-DBD

Posted: Dec 5, 2011

Comments

daobydesign on December 13, 2011

Sorry to bump, but anyone? This seems like pretty reasonable and straight-forward functionality, but there doesn't seem to be a way to set up a rule on the calculation of the total. Any help is much appreciated.

rfay Randy Fay on December 14, 2011

The problem we have right now is that we don't yet have a good way to get order total by line item type in rules. So it's hard to get the total without the discount, which means things can get recursively applied. But I'm hoping to have a good answer for order-level discounts before long.

ngwong on February 15, 2013

Does 7 x-1.5 just released a few minutes ago solve this problem?

Following up - I just tried it.

It solved my problem with inconsistent showing of the shopping cart block components, sometime leaving out component prices in some menu tabs but not in others.

Unfortunately, it does not allow access to the field_data_commerce_price data for me to show in Views. It is limited only to field_data_commerce_unit_price (i.e. commerce line item: unit price). So one is stuck with just showing the adjusted unit_price. It would be good for commerce to provide a price line item to access.