When a new return is created and populated with return line items, the commerce_return module assumes that all order line items for the same product id have the same price - which does not have to be the case.
For example - an order with 2 line items:
1) product id 1, quantity 3, price 1000 EUR,
2) product id 1, quantity 2, price 2000 EUR (or, even better, USD).
The return created for such order will have 5 return line items, each with price 1000 EUR.
The problem is that commerce_return_new_configure_line_items() uses only product_id value when grouping order line items for quantity calculations, and doesn't allow for anything else.
Patch to follow.
Comments
Comment #2
maciej.zgadzaj commentedComment #3
jkuma commentedVery good catch, and hook alter is correctly documented.
Comment #4
jkuma commentedCommitted to 7.x-2.x