-1

I'm developing a WordPress plugin using ACF and WooCommerce.

I created two Custom Post Types. The first one is "Clients" and the second one "Actions". The purpose of this plugin is to list all the clients (from a company) and list every actions of this company.

In the CPT Clients, I'm using an ACF number field to store their credits, for each client. All actions cost credits, I created a system that updates the total amount of the client's credits, by subtracting the cost of the action.

Now, I want to allow clients to buy credits if they need them. To do it, I choose WooCommerce. I created some "virtual" products.

My question is : after an order, how can I update the total amount of client's credits ? I don't know WooCommerce at all, I tried to read and to search but I didn't success. What functions can I use ? To resume, I want update the ACF number field of my CPT by adding the credits that have been purchased by the client.

Thanks in advance.

Emilien
  • 11
  • 3