I have problems with my workflow, say i want to sell an item and i have 1 left, 2 person click the same time in my workflow ends up buying it, i only want 1 to be able to, and somehow send a popup saying its been sold, please anybody know how to do that?
You can check stock status at the time a user adds it to their cart (or enters the checkout process if there is no cart) instead of after the purchase succeeds, effectively reserving the item for a period of time. Set a workflow to run at some time in the future (10 minutes?) to check if the transaction completed. If it did not, then return the item to stock.
Without knowing more about how your workflows are made, I made the assumption that you only lower stock once the transaction succeeds.
Sorry for late response didnt see notificiation! Ok thanks for reply! But how do i do a check workflow? u have any ideas how i can make such a workflow? I only have ‘‘make changes to a thing (DATA) then only when current item is not 0’’ or do i have it all wrong?
You’re on the right track with the “make changes only when current item is not 0”. I think you would maybe also want to make a new field named “reserved stock” or something along those lines. When a user adds it to checkout you would subtract one from “stock”, add one to “reserved stock” and schedule a backend workflow to run 10 minutes from current time that would return that “reserved stock” to “stock” if the purchase hasn’t been completed yet.