Question

We have fabric on a roll which we cut to requirement. Let's call this main product 'Red Fabric'. We have 100 (metres) in stock.

We want a dropdown showing customers length options they can buy; 2m, 3m, 4m etc. We do not however want to set these up as having there own stock levels as stock is same as parent product.

When purchased, a 2m would reduce stock of main product by 2, a 3m purchased would reduce stock by 3 etc.

We cannot just use a simple product and use product quantities as we want to see the order as:

  • 1 of the 3m 'Red Fabric'

and

  • 1 of the 5m 'Red Fabric'
Was it helpful?

Solution

First: using meters as qty makes sense, Magento also has an "allow decimal qty" option, so that you could have a stock of 0.5 or whatever as well.

For your other requirement, I would suggest using bundle products. You would have one simple product "red fabric" which is not visible individually and a bundle product configured like this:

  • Option 1:
    • Title: 3m
    • Input Type: Dropdown
    • Is Required: No
    • Selections:
      • Red Fabric, Default Qty: 3, User Defined Qty: No
  • Option 2:
    • Title: 5m
    • Input Type: Dropdown
    • Is Required: No
    • Selections:
      • Red Fabric, Default Qty: 5, User Defined Qty: No
  • ...

This will not give you a single dropdown (because you cannot add the same product multiple times to a single option, but multiple optional selections.

But as each dropdown only has two options ("nothing" and "red fabric"), you can change the template for bundle options to hide these dropdowns and show a single dropdown as per your requirements instead, which contains all options at once. With JavaScript you can then update the hidden dropdowns on change.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top