I need to make a system where the user can buy "credits/point" through woocommerce. When the user had bought money he/she can access a form.

Description of the process:

  1. The user buy some credit

  2. The user get access to a form, if the user had bought 10 "credits/points", he/she can go to the form and fill it for 10 times.

  3. When the submit button on the form is touched, the counter of credits should go one down.

Does anyone have an idea how i can do this?

1 Answer 1


Probably going to be a custom meta type on the users. During the sign up process to your website use the add_user_meta() function and declare the value as 0. Then as people buy from your shop you're going to have to find a hook somewhere in WooCommerce (Maybe on the order complete page?) to update the value. Then I presume you have coded the form yourself so just update the user meta to minus one every time they submit the form. You're also going to have to check they have a positive score too. For updating the user meta see the update_user_meta link.

https://codex.wordpress.org/Function_Reference/add_user_meta https://codex.wordpress.org/Function_Reference/update_user_meta

Not the answer you're looking for? Browse other questions tagged or ask your own question.