Add a fee to an order programmatically in Woocommerce 3
问题 I'm creating Woocommerce totals 'on-the-fly' as my cart items are imported from another CMS. Currently I am having trouble setting a custom 'fee' for each order , then marking the order as 'on-hold': $order->set_date_created($creation_tsz); $order->set_address( $address, 'billing' ); $order->set_address( $address, 'shipping' ); $order->set_currency('GBP'); $order->add_fee('Imported Total', $imported_total_here); $order->set_fee(); $order->calculate_totals(); $order->update_status('on-hold');