Problem/Motivation

Found that when adding a commerce order line item that it would use an erroneous amount left over in cache or other that shouldn't when adding a new discount order line item.

commerce_discount_set_existing_line_item_price() calls commerce_discount_add_price_component() which uses existing values.

Proposed resolution

Make another function for setting the order discount price component

commerce_discount_set_price_component

and have commerce_discount_set_existing_line_item_price us that.

Remaining tasks

User interface changes

N/A

API changes

Additional function.

CommentFileSizeAuthor
#1 2485207-1.patch3.62 KBjoelpittet

Comments

joelpittet’s picture

StatusFileSize
new3.62 KB

Here's a patch, it also abstracts the updating total stolen part into a helper function and resets the cache for the changed line item since we aren't saving it.

joelpittet’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: 2485207-1.patch, failed testing.

Status: Needs work » Needs review

joelpittet queued 1: 2485207-1.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1: 2485207-1.patch, failed testing.

The last submitted patch, 1: 2485207-1.patch, failed testing.

The last submitted patch, 1: 2485207-1.patch, failed testing.

joelpittet’s picture

Status: Needs work » Fixed

Reviewed this with @lauriii at drupal con and it's pretty innocuous and helps separate the tasks of adding vs setting.

Status: Fixed » Closed (fixed)

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