D
D
DeniSidorenko2020-12-29 09:57:34
WordPress
DeniSidorenko, 2020-12-29 09:57:34

How to send a request after Woocommerce product generation?

Good afternoon, there is an API that sends SMS. Tested yesterday through Isomnia, everything works well (on JS), there is an online store. After generating the product, you need to send an http request with the necessary parameters. How can I do this in php. I suppose that in functions.php put a function that, upon successful formation of an order, it sends an http request. But what function in WC is responsible for the execution after the successful formation of the order?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Fink, 2020-12-29
@DeniSidorenko

add_action( 'woocommerce_new_order', 'your_function', 1, 1 ); //Хук создания нового заказа
function your_function( $order_id ) {
    // Ваш код здесь
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question