Get FedEx Shipping Method IDs
-
Hello, I am trying to add a shipping method to an order by using the FedEx Shipping Method ID.
$order = wc_get_order( $order_id ); $item = new WC_Order_Item_Shipping(); $item->set_method_title( "FedEx Ground" ); $item->set_method_id( "fedex:11:FEDEX_GROUND" ); $item->set_total( $new_ship_price ); // (optional) $item->calculate_taxes($calculate_tax_for); $order->add_item( $item ); $order->calculate_totals();
But this is not giving me the FedEx Ground rate, it’s giving me the FedEx Standard Overnight rate.
By inspecting the value of the Shipping methods on the Checkout page, I can see:
<input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_fedex11fedex_ground" value="fedex:11:FEDEX_GROUND" class="shipping_method">
Is there some other way to get the shipping method ID for the FedEx rates?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get FedEx Shipping Method IDs’ is closed to new replies.