Add to cart form with ability to buy two same products with line item fields
I'm looking for a solution to make add to cart form for contact lenses. For choosing vision defect parameters I use line item fields. The problem is that user needs ability to buy second product if he got different defect on other eye in same add to cart form.
When user choose different defect for second eye something like that needs to show up:
I'm looking for solution to make such add to cart form.
I have two ideas:
- Making two add to cart forms per display page. First normal and second with two same products (as showed on second screenshot). Using radio button I can switch between forms.
- Having only one add to cart form but using radio button to show additional line item for same product.
I don't know how I can handle that ideas. I thought that I can somehow use or hack "Commerce Add to Cart Extras" but it doesn't allow to show line item fields. Any tips or some code samples how to make custom (similar?) add to cart form would be useful.