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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3537964-4.commerce_affirm_adjustments.patch | 1.61 KB | rszrama |
Issue fork commerce_affirm-3537964
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
Comment #3
rszrama commentedPatch 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.)
Comment #4
rszrama commentedWell, 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.
Comment #7
vmarchukComment #9
vmarchukCommitted!