0

I was wondering if how to set the Order ID instead of Post ID. I want it numerically arranged ASC to corresponding Booking. At the moment the order ID is assigned as inserted_post_id which only fetch the Post ID number not an actual Order number.

i.e.
First Order - 001
Second Order - 002

I want this to be visible in Booking Order CPT, for example.

How can I achieve that.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
  • 1
    As WooCommerce order is a custom post, the order ID is the post ID. But there is the order number that can be manipulated as you want… what you can do is to set the order number as just as you like, using the filter `woocommerce_order_number` (that is linked to the method `get_order_number()`), a bit as explained [in this answer](https://stackoverflow.com/a/64898355/3730754), where you will create a specific metadata handling an order number different from the Order ID. Note that the order number is displayed everywhere via the method `get_order_number()`… – LoicTheAztec Jul 26 '23 at 06:22
  • But the listings of products is a custom post types done via Jet Engine and Jet Booking and not anyway related to Woocommerce . Ony the payment is integrated with woocommerce checkout function . I created a Booking Order CPT to fetch all the information from the booking form but I want to pull out the order number too . Basically , the " Booking " itself by jet booking has the order number but the Booking Order CPT I created doesn't have one . – Coated Pill Jul 26 '23 at 14:54

0 Answers0