E
E
edgar_mav2018-02-10 00:03:26
Online shopping
edgar_mav, 2018-02-10 00:03:26

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

3 answer(s)
W
WordPress WooCommerce, 2018-02-10
@maxxannik

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

B
Bodrosh, 2018-02-10
@Bodrosh

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

V
Vova, 2018-02-13
@vova87

If there are not many keys, then you can place each key as a product, and put them in 1 piece. After the purchase, such a product will become unavailable for sale.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question