By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,397 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

Product variants in an ecommerce application

P: n/a
Hi all,

I am trying to create a product variants facility for an ecommerce site
(php/mysql).

Each of my products have options & option values stored in the db like
this:

-------------------- -------------------------
| product_options | | product_option_values |
-------------------- -------------------------
| option_id | | option_value_id |
| name | | option_id |
| product_id | | value |
-------------------- -------------------------

I have created product variant tables as follows:
-------------------- -------------------------
| product_variants | | product_variant_items |
-------------------- -------------------------
| variant_id | | variant_item_id |
| price | | variant_id |
| weight | | option_id |
| stock_available | | option_value_id |
| product_id | | |
-------------------- -------------------------

This allows the stock, price etc to be set for combinations of options.

For example:
Blue/Medium/Long Sleeved
Blue/Large/Long Sleeved

The problem comes when i try to generate these variants from the
product options. I need to get all the combinations as shown in the
example but i have no

idea how to do it. For the moment i have created a form where each
combination can be added manually but idealy this would be generated
automatically.

Of its more than possible that this is just not the way to do it ;0)

I'd appreciate any thoughts anyone might have,

Cheers,

Steve

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.