M
M
makboriska2021-11-30 00:21:36
WordPress
makboriska, 2021-11-30 00:21:36

How to get order data on the "thank you" page?

There is a need on the "Thank you" page to get information about the order, namely:

1) Type of goods (for example, simple)
2) Quantity of goods (of a particular type (simple)
3) Denomination (arbitrary field ACF PRO 'nam')
4 ) Order ID

How do I do this? The bottom line is that I need this data to generate a request to the server of the provider of codes (licenses), and the essence of the script is as follows:

1) The user bought a product of the (simple) type, it is redirected to the "Thank you" page, at this moment a get request is generated to the server supplier, we receive the code and send this code to the person by mail and write it to the database. This is not a commercial site, I just want to learn more for myself.. thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2021-11-30
Semenov

You can use woocommerce api
https://woocommerce.github.io/woocommerce-rest-api...

W
WP Panda, 2021-11-30
@wppanda5

The thankyou.php page contains the $order variable which contains the order object with all the data
https://github.com/woocommerce/woocommerce/blob/36...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question