maher
Newbie
- Messages
- 13
- Reaction score
- 2
- Points
- 3
Hello,
I would like to create a e-commerce site with different products. In particular:
If I add an X product, this product will have a variable attribute and the price of this product will be related to this attribute.
Example:
If the product X1 has a "weight" attribute, I can put this in place:
1 / weight = 0.5kg ==> price = 2usd
2 / weight = 1kg ==> price = 3usd
If the product X2 has two attributes "Size" and "type", I can set up this:
1 / size = 0.5m & type = t1 ==> price = 10usd
2 / size = 0.5m & type = t2 ==> price = 13usd
2 / = 1.5m & type = t1 ==> price = 11.5usd
I hope I'm clear enough ...
My question is: how can I put this in place with a MySQL database? What will be the model? (the attributes are dynamic, the administrator chooses the attributes and sets the price).
I would like to create a e-commerce site with different products. In particular:
If I add an X product, this product will have a variable attribute and the price of this product will be related to this attribute.
Example:
If the product X1 has a "weight" attribute, I can put this in place:
1 / weight = 0.5kg ==> price = 2usd
2 / weight = 1kg ==> price = 3usd
If the product X2 has two attributes "Size" and "type", I can set up this:
1 / size = 0.5m & type = t1 ==> price = 10usd
2 / size = 0.5m & type = t2 ==> price = 13usd
2 / = 1.5m & type = t1 ==> price = 11.5usd
I hope I'm clear enough ...
My question is: how can I put this in place with a MySQL database? What will be the model? (the attributes are dynamic, the administrator chooses the attributes and sets the price).