Woocommerce – how to provide upgrades to purchased products

My woocommerce site sells digital products.

When I provide a bugfix or a new version, I would like to give automatic upgrades to existing customers.

Read More

It appears that I will need to create an order with the a 100% “discount”, so as to enable access and downloading for each customer.

However, I have been unable to find a concrete example on how to create an order programmatically, add products to it, update values and save it as completed – in a correct manner so that all custom hooks and filters are called correctly.

Is there a complete tutorial available anywhere ?
Has someone already done this kind of thing ?

Related posts