I need special functionality on my Wix stores app - when a member adds items to their cart, then checks out, the item/s must be automatically removed or “sold out” as soon as they press the checkout button (so, if they immediately return to the product page, the item is listed sold).
Currently, I have set the item to 1 in stock (inventory). When a member selects this item and adds to cart, then checks out. I have to manually select “Paid” and only then the item is marked as “out of stock” on the products page. I am looking to have this automatically go out of stock when they press checkout. How can I achieve this with code, and in what page would the code be placed? Any help will be greatly appreciated!
This wouldn’t be possible with the Wix Stores pages but you could use the wix-stores and wix-stores-backend APIs to build your own custom store pages.
This way you could write some code that will reduce the amount of products in your database collection upon a button click. The wix-data API would be helpful too, as well as the wix-pay API.
It is not possible to interact with individual elements in the Wix Stores widgets using code and you cannot access the checkout page on the Editor to add any code there.
I am having the same problem, I think. Setting up my store, and when someone buys something (one-of-a-kind) it is still listed as available. I need it to automatically indicate “sold out” or possibly remove it from the store when it is purchased. This answer is several years old. Is it possible now?