0

I have car parts products in my M2 store and I need to give my clients availability to filter parts by model of car and year. Each product can be attached to different models/years, in example:

Cabin air filter:

Honda Civic - 2016
Honda Civic - 2017
Honda Civic - 2018
Honda Accord - 2013
Honda Accord - 2014
Honda Accord - 2015
Honda Accord - 2016

If I would have only models, I could add just simple product attribute. But how should I handle this situation, when I have "parent" attribute (model) and "child" attribute (year)?

  • you can handle this with configurable products or bundle products. – ASQ Apr 18 '19 at 9:12
0

Magento 2 doesn't support parent-child product attribute.

Design table as following:

Make: ID, Name, Created_At (Honda, Audi, BMW, Ford.. )
Model: ID, Make_ID, Name, Created_At (Civic, Accord, A3, A4 ...)
Year: Make_ID, Model_ID, From, To, Created_At (2015, 2016, 2019...)

And use this table to link product with vehicle (Make, Model, Year)

Product_Vehicle: ID, Make_ID, Model_ID, Year_ID, Product_ID
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.