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

maciej.zgadzaj created an issue. See original summary.

maciej.zgadzaj’s picture

Status: Active » Needs review
StatusFileSize
new4.52 KB
jkuma’s picture

Status: Needs review » Reviewed & tested by the community

Very good catch, and hook alter is correctly documented.

jkuma’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x-2.x

  • jkuma committed 04ba283 on 7.x-2.x authored by maciej.zgadzaj
    Issue #2868697 by maciej.zgadzaj, jkuma: Same product, different prices...

Status: Fixed » Closed (fixed)

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