dqd2800
2018-08-24 09:54
浏览 73
已采纳

WooCommerce ajax获取订单状态

My WooCommerce store will be updating the order status within a few minutes to a number of different states. Similar to how online pizza trackers work e.g. in the oven > baking > checking > delivering.

I'm currently displaying my order status on the thank you page -

<h3 class="order-status"><?php echo $order->status; ?></h3>

But I want to use ajax and possibly a jQuery set time out to update the status every 10 seconds.

setTimeout(fetchStatus, 10000);

I'm not sure what call to make will I have to create a function that uses the global $wooCommerce variable and keep updating it that way?

To confirm this is on a custom woocommerce thankyou page template.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题