How to show woocommerce order in external php page not in the wordpress order page
i mean when a customer make an order through woocommerce I want to show the order in external php page like the order id and name and address and phone number in external php page but in the same path for wordpress.
thanks
Regards
Question posted in Woocommerce
The official Woocommerce documentation can be found here.
The official Woocommerce documentation can be found here.
2
Answers
More information :
IF you need data on rest of wordpress site use REST API :
Copy the Woocommerce checkout template to your theme:
wp-content/themes/my-theme/woocommerce/checkout/thankyou.php
modify this page as you see fit to either redirect to a different page, add an include, etc. First, get your order number. Somewhere around like 40, (where the comments state "order successful"), get your order number:
As long as you have the order id as a variable, getting order details is easy with a mysqli query:
This works completely outside of WordPress. You just need the database connection info from the wp-config.php file. You can find other attributes by searching the wp_postmeta table by order number in something like phpMyAdmin or SQL workbench if you want different info.
Does this help?