We currently serialize promotion, tax, and shipping adjustments into the checkout object, but other modules or custom code on sites may be defining other types of adjustments. We need to accommodate those as well, either via discounts (for negative adjustments) or pseudo line items (for positive adjustments, like fees).

Thanks to @seanmacgillivray for the proposal / patch.

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

rszrama created an issue. See original summary.

rszrama’s picture

Status: Active » Needs work
StatusFileSize
new1.37 KB

Patch attached that upon review likely needs to be improved to support multiple "anonymous" adjustments of the same type. Right now in the promotion adjustments section of the same function we basically sum adjustments with the same array key together. I think we can default to that for unknown adjustment types as well.

(Note: this isn't a problem for unknown "positive" adjustments, as we don't have to provide an array key for line items.)

rszrama’s picture

StatusFileSize
new1.61 KB

Well, I hoped for a fast fix, but unfortunately, I ran into an issue where apparently Affirm will combine our pseudo line items for "positive adjustments" (i.e., fees) if they have the same SKU, even if they have different prices. I installed Commerce Fee to test the patch, had a $25 fee and a $0 fee, and Affirm combined the two adjustments into one line item of $25 with a quantity of 2, charging double as a result.

I suppose we may need to append an increment value to the adjustment type to avoid this.

vmarchuk made their first commit to this issue’s fork.

vmarchuk’s picture

Status: Needs work » Needs review

  • 2983bdbf committed on 2.x
    Issue #3537964: Accommodate unknown adjustments when building the...
vmarchuk’s picture

Status: Needs review » Fixed

Committed!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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