I have made a simple webshop with woocommerce, with three payment methods. iDeal and by direct bank transfer and on account. The order ID is created based on the payment method. for example, if payment is made with iDEAL, the order id becomes ID190100; if payment is made on account, the order id becomes RK190100. I get this working with the plugin
“Sequential Order Numbers for WooCommerce” from BeRocket but these are already created before the payment is complete. The order ID must only be finalized once the payment has been made. Now orders that have not yet paid, and may not be paying, will receive a fixed order ID. So is it possible to create a temporary order id and when the order is completed change the order id based on payment method?
Question posted in Woocommerce
The official Woocommerce documentation can be found here.
The official Woocommerce documentation can be found here.
2
Answers
Try this. It’s very quick example. Hope help.
Woocommerce by default will use the post ID of the order for the order ID. This is evident when viewing the
WC_Order::get_order_number()
method. If you want to use a custom order number to display, you’ll need to add a filter onwoocommerce_order_number
to load in a different value.An example script would be: