PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi guys, I was thinking that when a customer purchase an item from my site the qty of stock will depricate by the amount they have brought. I was wondering how i could code this and this is what i came up with for a function. Any ideas of any other ways or if this way wouldn't work. I don't have the other scripts done to test it yet but im sure it wouldn't work.
you never perform the update query. It doesn't need the selection query.
I'd suggest not deducting inventory at the time of purchase, but at shipping.
If anything, I'd mark the inventory as pending removal. This way, if the inventory suddenly drops below the level of their request, we could send a notice stating as such as that the order has been moved to backordering, to be filled upon receipt of a new shipment of product.