I am creating a WooCommerce order programmatically but I cannot seem to get Tax added to A custom shipping method. Here is my code:
$shipping = new WC_Order_Item_Shipping();
$shipping->set_props(
array(
'method_title' => "Tracked (2-3 business days)",
'method_id' => "advanced_flat_rate_shipping:779",
'taxes' => array(),
'tax' => array(),
'calc_tax' => 'per_item',
'total' => 4,
'tax_class' => 'standard',
'total_tax' => 0.80,
)
);
here is a snapshot of an order with the tax field blank – https://snipboard.io/BoWZJT.jpg