close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Deleting sold out item from database after purchase

Thread began 3/13/2011 4:53 pm by phil107723 | Last modified 3/15/2011 4:52 pm by CraigR | 974 views | 4 replies |

phil107723

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

Sign in to reply to this post

Jason ByrnesWebAssist

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.

Sign in to reply to this post

CraigRBeta Tester

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

Sign in to reply to this post

phil107723

Thanks for advice

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?

Sign in to reply to this post

CraigRBeta Tester

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.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...