How do I retrieve the order ID in WooCommerce?
相关问题
- Display product ACF field value in Woocommerce tra
- Adding a custom button after add to cart button in
- How to add a “active” class to a carousel first el
- Setting custom order statuses as valid for payment
- change the font size in tag cloud
相关文章
- wordpress新增页面如何个性化设置
- select query in wordpress
- Get WooCommerce featured products in a WP_Query
- Woocommerce update shipping methods in checkout vi
- Change order status just after payment in WooComme
- Publishing or uploading failed. Error message: “Th
- Facebook Login With WP JWT Auth
- Wordpress development process
I didnt test it and dont know were you need it, but:
Let me know if it works. I belive order number echoes with the "#" but you can split that if only need only the number.
If you
then you'll be returned the id of the post from which the order is made. As you've already got that, it's probably not what you want.
will return the id of the order (with a # in front of it). To get rid of the #,
as per the accepted answer.
As of woocommerce 3.0
will not work, it will generate notice, use getter function:
The same applies for other woocommerce objects like procut.
it worked. Just modified it
This is quite an old question now, but someone may come here looking for an answer:
This should return the order id without "#".
EDIT (feb/2018)
The current way of accomplishing this is by using: