I don't think the default behavior can be changed, at least not easily. Theoretically you can try to override ReturnOrderLineItemEdit and return different quantity, but it is grey area and not officially supported.
I of course don't see the big picture here but I think Commerce should be able to handle 1.5M variants. That's a big number, yes, but it should be doable, with some careful modeling and considerations. That would solve a lot of problems - but again, I don't have all the information regarding the decision so my words are not the definitive
Thanks for your answer Quan.
I will have a look it and see what I can do.
It's good to know Commerce can handle that kind of volume. In this project it's to late to change but I will take this in to consideration next time I meet the same kind of issue.
I'm using Episerver Commerce version 11.8.3.
So, in this project we are using Commerce Manager (CM) to create a return. More or less like the description here: http://webhelp.episerver.com/latest/commerce/order-management/returns-and-exchanges.htm
A little bit of background:
We have products with with up to 1.5 million variants. After a discussion with Episerver we was recomended to not have all the variants in the commerce database. We should not have more than 300 000 - 400 000 variants. So that's ok and we managed to solve that issue.
We ended up having variants with multiple properties that have a range. e.g: Property 1: from 1 to 10 with step 1 -> showing a dropdownlist with 1,2,3,4,5,6,7,8,9,10.
So to handle this we had to add lineitems to the cart and order with the same variant code but with different properties. The cart and orders handles this and we have no problem with showing this to the customer.
Then, over to my problem:
We are now looking at returns and we have decided to use CM to create a return for a shipment. I thought that should not be a problem but after some testing I figured out that there is a problem when we have to line items with the same variant code.
Line 1: Variant code 1 has property 1 set to 1.
Line 2: Variant code 1 has property 1 set to 2.
Now, when clicking the "Create Return"-button in CM and then "New line item" I see both lines in the dropdown (ref link above) and can select one of these and add it to the return form.
Now, when I click at the "New line item" the dropdown just contains one line, which is expected, but when I add 1 to "Return Quantity" I get the error message: "Maximum quantity to return: 0.00".
I'm able to create two returns but I would like to have everthing in one return form.
Is that possible?