Create a WooCommerce Order Dynamically

Remi | April 4, 2017 | in Tips

Alright, so you’d like to create an order dynamically within WooCommerce? Well, let me tell you you found the right post!

Here is a super small snippet that will allow you to create a new order on the fly and dynamically when the function is triggered, simply load the function when needed and adjust it. You could easily improve it by adding  a lot of custom fields, but this is not the 1st intention of this post! Enjoy

The author

About the author Remi: Hey! My name is Rémi Corson, I'm a French WordPress Developer, I code stuff and I write from time to time ;-)

2 Comments

  1. Pingback: [WooCommerce] 客製化訂單與結帳流程的作法 - 一介資男

  2. Collins Agbonghama

    We are working on a project that requires creating order dynamically. Isn’t there a function where you specify the product ID and number of item to add to cart available in WooCommerce?

    Oh I see. the ‘add_product’ method in wc_create_order() object can be used.

    Thanks.

Leave a reply