I am making an E-commerce solution that needs to be a multi-store solution. I am seriously stuck while making the Associations between Products and it's features. As it is a multi-store solution I need dynamic feature possibilities per product. I came up with three entities: Product, FeatureKind & FeatureValue.
- FeatureKind has the basic feature names like Size, Color, Style, etc. Also has a M:M connection to the FeatureValue entity.
- FeatureValue obviously contains the values for the FeatureKind like Small, Medium, Green, Red, Blue, Full-Sleeved, etc.
- Product entity is connected to FeatureKind with a M:M association.
I am having a few problems in this type of structure:
- What if I have a Product that only has Small size, it shouldn't also show up Medium in options. What if a product only has Green color, it shouldn't also show Red and Green, and so on.
- Secondly, What if I have a product that is available only in Green in Small size and Red in the Large size. how will that work out?
I'm sure I need to change my structure and architecture both, Luckily the project is in Symfony2 and I only have the product bundle to make.
I would be happy to post the entities here but my problem is concept and not code. If you need to see it just comment and I'll edit the question.