Create a new shipping zone instance to attach to a WC_order
-
I have a plugin that will duplicate an existing woocommerce order. However, with the upgrade to 2.6, I don’t know how to create a new shipping zone/instance to attach to the duplicated order. For example, when I invoke $wc_order->add_shipping( shipping_rate), I don’t know what parameters to pass to add_shipping method. Before, I can create a shipping rate object. But now, it should be a shipping zone, but I don’t know how to create it. Can you give an example of creating a shipping zone object? Would it be something like:
$shipzone = new WC_Shipping_Method();
$shipzone->label = “test zone”
$shipzone->id = “testzone:3”
$shipzone->cost = 1.99Any help is appreciated.
- The topic ‘Create a new shipping zone instance to attach to a WC_order’ is closed to new replies.