Needs work
Project:
Commerce Discount
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Mar 2017 at 17:13 UTC
Updated:
7 Jan 2020 at 02:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sonixax commentedAny Idea afte about two weeks ?
Comment #3
imrubio22 commentedI would also like this to work. I can get this to work with Discount Extra using the Per-quantity product discount options but it's not ideal because even the discounted item needs to be already added to the cart.
I like the Add Free Bonus Products option because it adds the bonus product to the cart but it should add 2 bonus products if 2 trigger products are in the cart as the original poster describes.
thanks in advance!
Comment #4
arefen commentedhttps://www.drupal.org/sandbox/rfnbnkr/2842310
this module solve your problem
Comment #5
rossb89 commentedEncountered this issue this morning.
The issue is, '1' is the hardcoded quantity value.
Written a simple patch that will pull the quantity in from the corresponding line item on the order, and set that instead of the hardcoded 1 value.
Comment #6
rossb89 commentedComment #7
joelpittetThanks for the patch and digging in @rossb89, it would be great if others who are loooking for this also test the patch and a test to ensure it works would be great if it could be added. (hint copy from existing tests and add a larger quantity and assert if its there in the checkout)
Comment #8
rossb89 commentedI had a think about this today... will look to add tests at some point when I have some time, but just thought of an issue where you might not always want multiple bonus products to match the cart quantity..
I think what's required here is a new extra option which effectively does what I patched here, 'add free bonus products (match cart quantity)' .. as you might not always want to have e.g. buy 5 get 5 free.. some offers might want buy 5 get 1 free, and with this patch, that would stop that functionality from being possible.
With an extra option, it would give the flexibility to have both use cases.
OR - try add a flag to the existing 'free bonus products' option .. 'match cart quantity' or somesuch.
Comment #9
Neo13 commentedThe patch would only work if free product and product in the condition to receive the free product are the same. That is not always the case.
Comment #10
narwhalbyte commentedThis patch works great, but now we can't do buy x get 1 free.
It seems that the discount options "Offer same amount of free products as bought" and "quantity offered" are ignored.
Is there any way around this?