RE: Specify product quantity for an attribute

burt <[email protected]>
Newsgroups gmane.comp.web.oscommerce.features
Message-ID <1dbf43d1de4bfa29767323d19f5e1fe9@osCommerce-Forums>
This message was sent from: Features
http://forums.oscommerce.com/viewtopic.php?p=191026#191026
----------------------------------------------------------------

I have not looked at the QTPro contribution for a while, as I did not want to install it as it looked too complicated.

I have a different idea, to achieve the same result:

1) When setting up your product attributes, give each one an integer value equal to the number of those attributes you have in stock.
2) In product_info.php amend the sql that makes the attribute dropdowns to only select attributes if they have an integer value greater than zero.
3) In the checkout procedure decrease the attribute integer value by however many attributes have been purchased.
4) When it is decreased, it will eventually get to zero, meaning all those atributes have been purchased.
5) When it gets to a low amount, send the Store Owner a warning email.
6) The Store can then get more attributes from his supplier, or can let the attribute quantity fall to zero.
7) When it is at zero, it will not show in the attribute dropdown, and will therefore be unavailable to be purchased.
8) Code up a quick admin section to allow to add integer quantity_available to the attributes.

Done.  Thoughts???
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.