In commerce_discount_compatibility_check, discounts currently applied are loaded for comparison. If the current discount (who's compatibility we are checking) has already been applied it will be included in the list of discounts to check.

This leads to the situation where a discount with the compatibility setting "Not with any other discounts" will fail and un-apply itself.

Comments

T-lo created an issue. See original summary.

t-lo’s picture

Status: Active » Needs review
StatusFileSize
new774 bytes
t-lo’s picture

Added a check to see if the discount has been loaded before unsetting it.

joelpittet’s picture

Assigned: t-lo » rszrama
Issue tags: +Needs tests

Thanks for the patch. Assigning to Ryan as he may better know how this bit should work. Though I have a rough idea, this part of it I don't.

Also could use a test to prove it's doing what's needed.

torgospizza’s picture

This patch is essentially a duplicate of one of the patches in #2621526: Compatibility settings other than "all" causes Discount+Coupon to be removed (some of the patches include essentially the same functionality as what this patch provides).

I nearly consider this a duplicate worth closing, however it might be best to take a piecemeal approach to this issue; therefore we might want to consider writing a test for just this issue and then patching it, and once we have proven that it is a valid fix, re-rolling #2621526: Compatibility settings other than "all" causes Discount+Coupon to be removed to accommodate the change.

t-lo’s picture

Certainly a duplicate but yes, my thinking was to provide a fix for a single issue that was affecting my site and one use case.

This seemed like a nice little chunk that could be pulled out and fix some issues quickly rather than waiting for the whole lot to get in.

rszrama’s picture

Status: Needs review » Closed (outdated)