Skip to content

Instantly share code, notes, and snippets.

Created September 22, 2022 04:26
What would you like to do?
Order Tracking Page Code for Advanced eCommerce website tutorial by WP Academy
function wpac_add_query_vars_filter( $vars ){
$vars[] = "order_id";
return $vars;
add_filter( 'query_vars', 'wpac_add_query_vars_filter' );
function wpac_order_status() {
$id = get_query_var('order_id');
$id = intval($id);
$order = wc_get_order($id);
if($order) {
$status = $order->get_status();
echo $status;
} else {
echo "No Data Found";
add_shortcode("WPAC_ORDER_STATUS", "wpac_order_status");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment