D
D
DeniSidorenko2020-06-22 14:01:57
WordPress
DeniSidorenko, 2020-06-22 14:01:57

How to send order data to Woocoomerce via api?

Good afternoon, please tell me which function is responsible for sending the order to the mail. More precisely, how to catch this event and send data about the order to CRM via CUstom APi? CRM is self-written and does not have a plug-in for connection - therefore, the connection is output via API

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pychev Anatoly, 2020-06-22
@DeniSidorenko

For a similar task, I hung on a hook woocommerce_checkout_order_processed
. It is called exactly when the order is placed. Moreover, if the payment is by bank transfer, then it is called before the payment is made, but when the buyer has already pressed the button to proceed to payment. In this way, you can catch a failed payment and show it to a manager who can quickly contact the buyer and help with a solution. And the WC_Email_New_Order
class is responsible for sending the order to the mail . You can see the hooks to which it connects by its trigger handler

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question