Answer the question
In order to leave comments, you need to log in
Wordpress key store (woocommerce) how to make several keys in one product?
Hello! Please tell me how to make sure that the same digital product, for example, Batman game keys for Steam, does not come across already bought by another person. Those. we have one product "game" no matter what. I have 30 activation keys for this game. How to make it so that they would be issued to buyers in turn and those already purchased are removed from the list of keys. To avoid the fact that a person bought a key, and it was already activated by a previous buyer. I would be very grateful if anyone can help and explain how to set it up!
Answer the question
In order to leave comments, you need to log in
I would try this:
1. make a metabox for entering a list of keys with storage as a special type of comment
2. make the mechanics of intercepting an order for such a product, where to take the last key, add it to the order meta and delete it from the product
3. add an office in which there will be a list purchased keys from each user
As an option, create a table in the database with the fields Code_Game, Key, Status (issued or not), then on the purchase page (after successful payment, show the user with a request one value from this table with the status not issued, and after this display, change this key in this table to Issued)
You can add a custom field to the user in which to store this key (or add to it, for example, Game 1: key, Game 2: key) and display it in the personal account
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question