I have the following setup:

Cart contents:
- product A: quantity 2, total 200$
- product B: quantity 1, total 50$

Discount Settings:
Qualification:
- Type: minimum quantity
- Amount: 2
- Require single SKU to qualify: checked

Application:
- Percentage off per qualifying item
- Amount: 0.1

All other options at default.

Expected behavior:
apply a discount of 20$ as only product A qualifies for the discount.
variation: apply a discount of 10$, only for the second instance of product A (this could be a separate discount type as mentioned in http://drupal.org/node/1285404)
product B should not get any discounts

Actual behavior:
a discount of 25$ is applied, this means the discount amount is calculated for the total price of all products.

Remarks:
When i add only one instance of product A and product B (quantity = 1 for both) no discounts apply at all, which is correct.

Similar issues:
http://drupal.org/node/611206

Looks like a bug to me, please let me know if my discount configurations are incorrect,
Thanks.

Comments

garyg’s picture

Bump
This is a great module
An important feature is broken and it would be great to see this fixed

Version 2.4
Has no effect = "Require single product SKU to qualify"

fonant’s picture

I think the issue is that "Require single product SKU to qualify" only affects qualification, and not discount application.

We probably need "Apply discount to qualifying product SKUs only" as a new option in the discount application section.

I have the same problem with "buy X get Y free": I want to both require all the X to be the same SKU, but I also want to restrict the free items to that SKU too. At the moment the free items are selected as the cheapest in the cart, regardless of SKU.

fonant’s picture

Hmmm... perhaps "percentage off per qualifying item" should indeed be working for you...

There isn't a "free items per qualifying item" option, which I think is what I need.

JayP’s picture

Category: bug » feature

Has anyone resolved this issue? I am having the exact same problem.
Discounts is calculated on total # of products in cart, not # of products individually.

Minimal amount to qualify for discount: 10

Shopping cart:
Product A x 9
Product B x 10

Discount is applied 19 times based on total # products in shopping cart.

What I would like the module to do is only apply discount to Product B, since Product A doesn't qualify for discount.

Although it's not really a bug, since the descriptive text below CONDITIONS OF QUALIFICATION explicitly states "Carts qualify for a discount based upon these conditions."

Help will be greatly appreciated since I am on a tight deadline.
Thank you!

JayP’s picture

I think I found a solution for this.

Bulk discount for number of individual products instead of total number of products in cart:

Create a discount for every individual product.
Specify minimum (and maximum) amount to qualify.
At Required Products specify "filter by product' and specify the product you want to discount.
Activate "Require single product SKU to qualify".
At Discount Application choose 'filter by product' and specify the product you want to discount (eg. Product A).
Name the discount appropriately (eg. 10% discount for 20x Product A)

Repeat for every product.
In Checkout you will see all discounts on seperate lines, 1 per discounted product.

Still would appreciate directions on how to get the individual discount lines to show on the invoice.
Thanks!

IanBezanson’s picture

StatusFileSize
new1.57 KB

From what I could tell, there is a bug in the code, affecting the module's ability to properly handle when to require the single sku to trigger a price-based discount. Furthermore, as noted above by many, when the discount was getting applied, it was getting applied to all items, not just the items which have triggered it.

I'm submitting a patch which works for the scenario where you want to only apply the discount to the triggered items. That said, if you want to apply the discount to all items, my patch will break your need. To really be done properly, there should be a checkbox on the backend to only apply to the single sku, and my patch to be modified to look for *that* setting when looking at applying the discount.

I am happy to work that out a little further if interest is there from the maintainer.

Cheers,

Ian

IanBezanson’s picture

StatusFileSize
new1.6 KB

Please ignore previous comment's explained limitations - the attached patch properly handles "Percentage off per qualifying item" when that is the discount type.

Ian

pelicani’s picture

thanks for posting this patch.
we are having the same problem with the discount module.
this patch is beginning to solve it for us.

we still had a problem because this patch uses the product price to determine if it gets applied.
when I change the patch to use quantity, it works pretty well.
we also need to add a test for the maximum amount.
and make it work with multiple discounts.

for example, we need to be able to have a discount for each item, if it qualifies.
and we have 5 different discounts, based on quantity levels.

thanks again for the starting point.
when we figure it out, perhaps I'll remember to post it as a patch on this issue.

peace,
michael