Hi,
I am starting to use Commerce Bundle module. A product bundle consists of multiple line items however it should count only as one product in cart (one bundle). Please see attached patch that solves this issue if Commerce Bundle module is enabled. Otherwise previous behaviour is unchanged.
Thank you.
| Comment | File | Size | Author |
|---|---|---|---|
| support_commerce_bundle.patch | 2.57 KB | Neo13 |
Comments
Comment #2
subhojit777Looks good to me. Just some minor improvements I have suggested.
Let the default
$quantity = commerce_line_items_quantity($line_items, commerce_product_line_item_types());stay, and thiselseblock will not be required.Let the default
$quantity = commerce_line_items_quantity($line_items, commerce_product_line_item_types());and thiselseblock will not be required.Comment #3
Neo13 commentedI added the else statement because I didn't want the commerce_line_items_quantity() function to run uselessly. That's a minor optimization but I will leave it up to your consideration.
Comment #4
subhojit777hmm.. agree with you on that. However, I was unable to apply the patch. It gives error:
The path in the patch needs to be corrected.
Comment #5
tonytheferg commentedI confirm:
I got the following trying to apply:
So i got the patch to apply to 7.x-2.11, but the functionality of adding bundles to cart did not change.