The Cart Manager is incorrectly combining order items with promotions

When creating a "BuyXGetY" promotion to offer a second product for free, if the user manually tries to add this second product to the cart, it gets combined with the order item generated by the promotion. During the cart refresh process, this extra unit is lost when the promotions are reapplied.

I'm not sure where to create the failing test, as BuyXGetYTest doesn't use the Cart Manager or have dependencies on the cart module.

Steps to reproduce it

  • Create a BuyXGetY promotion, where when one unit of product X is purchased, one unit of product Y is obtained for free.
  • Add one unit of product X to the cart; one unit of product Y is automatically added to the cart.
  • Try adding one unit of product Y to the cart manually. Upon refreshing the cart, there is only one unit of product Y.

Issue fork commerce-3474765

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

facine created an issue. See original summary.

facine changed the visibility of the branch 3474765-cart-manager-is to hidden.

jsacksick’s picture

Priority: Critical » Normal

I think the fix is correct, no need to specify 1 after continue as it is the default value.
I just wished there was a way for the cart module to not hardcode the flag, but I guess we can live with that.

  • jsacksick committed 84e869d2 on 3.0.x authored by facine
    Issue #3474765: Cart Manager is incorrectly combining order items with...
jsacksick’s picture

Status: Active » Fixed

Merged!

jsacksick’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.