The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> HTML 5 - Store Counter that switches item to "sold out" after a certain number of purchases / clicks
bigmowebsites
post Aug 7 2020, 10:52 AM
Post #1





Group: Members
Posts: 8
Joined: 7-August 20
Member No.: 27,478



Hello WDG Community-

I am in the process of creating an HTML 5 website for a friend - the site is coming along nicely, however I am struggling with one specific thing; my friend wants a feature implemented where the system will count how many items are sold, and then once the item is sold, it will no longer let the item be purchased. For example -
My friend has 10 shirts he wants to sell. Once 10 of them have been sold, is there a way to make the button non clickable until the item is back in stock? I think this requires a server to be implemented - if so I can try to download a virtual server on my PC.

Thanks in advance, any help is greatly appreciated smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post Aug 7 2020, 01:28 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



Usually this is done with a database (MySQL is free and popular) where you can list every product in a database table by e.g. product number, price, inventory etc.

If the site is extremely simple (like just those ten t-shirts) you might read and write to a textfile instead (a so called flat-file database) using e.g. PHP.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 04:23 PM