Inventory/Stock Tracking
Posted: Sun Dec 03, 2006 4:53 pm
I have created a shopping cart script and am wanting to add a Inventory/Stock Tracking script that notifies the admin when they are low on stock... This would normally be easy however I have set-up the script so that you can add "options" to your products. Options could be anything such as size, colour, make etc... Because there are options, I need tot rack the stock of each option combination.
The product name is:
Shoes
And has these size options:
Small
Medium
Large
And these color options:
Red
Blue
Green
The above options would need to be put into a list like this... I could then have a text box at the end of each line where you would enetr how much stock is left.
Shoes Small Red
Shoes Small Blue
Shoes Small Green
Shoes Medium Red
Shoes Medium Blue
Shoes Medium Green
Shoes Large Red
Shoes Large Blue
Shoes Large Green
Now for my question.
How would I select all those different options from the database and put them in the list like above without having duplicates? What I mean by duplicates is the list would end up like this:
Shoes Small Red
Shoes Small Blue
Shoes Small Green
Shoes Medium Red
Shoes Medium Blue
Shoes Medium Green
Shoes Large Red
Shoes Large Blue
Shoes Large Green
Shoes Red Small
Shoes Red Medium
Shoes Red Large
Shoes Blue Small
Shoes Blue Large
Shoes Blue Medium
Shoes Green Small
Shoes Green Medium
Shoes Green Large
Only having the two options (Size and Color) makes it a little easier but if you had 3, 4 or even 6 options, it would get a little more complicated.
Hopefully I'm making sense.
The product name is:
Shoes
And has these size options:
Small
Medium
Large
And these color options:
Red
Blue
Green
The above options would need to be put into a list like this... I could then have a text box at the end of each line where you would enetr how much stock is left.
Shoes Small Red
Shoes Small Blue
Shoes Small Green
Shoes Medium Red
Shoes Medium Blue
Shoes Medium Green
Shoes Large Red
Shoes Large Blue
Shoes Large Green
Now for my question.
How would I select all those different options from the database and put them in the list like above without having duplicates? What I mean by duplicates is the list would end up like this:
Shoes Small Red
Shoes Small Blue
Shoes Small Green
Shoes Medium Red
Shoes Medium Blue
Shoes Medium Green
Shoes Large Red
Shoes Large Blue
Shoes Large Green
Shoes Red Small
Shoes Red Medium
Shoes Red Large
Shoes Blue Small
Shoes Blue Large
Shoes Blue Medium
Shoes Green Small
Shoes Green Medium
Shoes Green Large
Only having the two options (Size and Color) makes it a little easier but if you had 3, 4 or even 6 options, it would get a little more complicated.
Hopefully I'm making sense.