RE: THE LIMIT OF OSC or the Product-Attribute-Stock problem.
tbannist <[email protected]>
| Newsgroups | gmane.comp.web.oscommerce.features |
|---|---|
| Message-ID | <053dccf79263c857cc25db6f23ff8a9b@osCommerce-Forums> |
This message was sent from: Features http://forums.oscommerce.com/viewtopic.php?p=158724#158724 ---------------------------------------------------------------- Here's the problem you are going to run into: How do you handle stock outs on option values? If you're out of green shirts, how do you let the customer know? Is it "good enough" to let him know that you don't have any when he hits the cart page, or should you let him know as soon as he selects green? The later woud either require reloading the page or javascript to change the choices on the remaining drop downs. The upside is it would fix the problem Tomakaze is running into as well (Since size small green shirts won't be an option unless there's some in stock). This is the difficult part, the database is actually fairly easy. On the database side you'd need to add a quantity field to each attribute and a field to control the quantities to both the products and the attributes. Then you have to look at whether the product is limited or unlimited, and if the product is limited you look at each attribute to see if it is limited or not. If the product is limited it's stock is decremented when sold, if the attribute is limited it is decremented as well. Otherwise, they are not decremented. Sounds simple enough.