Deleting sold out item from database after purchase
I want to have a product deleted from a database after the last item is sold. How would I do this ?
Thanks
I want to have a product deleted from a database after the last item is sold. How would I do this ?
Thanks
This will require a bit of hand coding to accomplish.
you will need to add code to the confirm page to lop through the purchased items in the database and update the available quantity , if the available quantity drops to zero, delete that item instead of updating it.
it should not be too difficult if you are familiar with hand coding php and writing SQL statements, but we will not be able to offer much support for this.
unless you are definitely not going to stock the item again, it may be better to add a 'display' field to the items table, and set its value to true when you want it to be available, and false if not.
that way, you can cope with stock shortages too, without having to re-key the record
Thanks Craig that was my initial thought but I need it to show the product is either no longer available to purchase or has been sold out as soon as the last one has been sold to stop other people from buying it.
Thanks Jason thats what I want to do but can't do the hand coding. Do you know anybody who can?
don't know how you're doing your inventory control, but you could consider setting your recordset to show only items where the stock qty is >0 , that way the item will automatically be unavailable once it is sold out.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.