Database design suggestions for a configurable product eshop
        Posted  
        
            by solomongaby
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by solomongaby
        
        
        
        Published on 2010-04-15T14:04:15Z
        Indexed on 
            2010/04/16
            10:13 UTC
        
        
        Read the original article
        Hit count: 438
        
Hello,
I am biulding an e-shop that will have configurable products. The configurable parts will need to have different prices and stocks from the main product. What database design would be best in this case?
I started with something like this.
Features
- id
 - name
 
Features Options
- id
 - id_feature
 - value
 
Products
- id
 - name
 - price
 
Products Features
- id
 - id_product
 - id_feature
 - value ( save the value from the feature-options for ease in search )
 - configurable (yes, no)
 
The problem is that now I am stuck on how to save the configurable product features. I was thinking of saving their value as a json. But that will make saving price modification for a certain option difficult.
How would you go about this ?
Thank you.
© Stack Overflow or respective owner