shipping-method

How to set a shipping cost by item in Woocommerce

最后都变了- 提交于 2019-12-01 10:36:32
In Woocommerce, when I add multiple products in cart, the shipping only applies to to 1 product. How should I change that to apply the cost to each item? Like in the following image, the shipping cost for printer is applied but the LCD monitor is not. How to set a shipping cost by item in Woocommerce? In the Woocommerce Shipping Settings for "Flat rate" Shipping Method, there is many ways to get dynamic settings based on: Item quantity, using [qty] argument Total item cost, using [cost] argument A fee, using [fee] argument with additional parameters percent , min_fee and max_fee You can also

Add a shipping to an order programmatically in Woocommerce 3

霸气de小男生 提交于 2019-11-30 07:42:38
问题 I've been trying numerous solutions to programmatically set the price of shipping (per order) via Woocommerce. I'm having no luck I have tried overwriting the meta value for the item: update_post_meta( $woo_order_id, '_order_shipping', $new_ship_price ); Also tried something along the lines of this [Question/Answer][1] $item_ship = new WC_Order_Item_Shipping(); $item_ship->set_name( "flat_rate" ); $item_ship->set_amount( $new_ship_price ); $item_ship->set_tax_class( '' ); $item_ship->set_tax

Add a shipping to an order programmatically in Woocommerce 3

五迷三道 提交于 2019-11-29 05:13:44
I've been trying numerous solutions to programmatically set the price of shipping (per order) via Woocommerce. I'm having no luck I have tried overwriting the meta value for the item: update_post_meta( $woo_order_id, '_order_shipping', $new_ship_price ); Also tried something along the lines of this [Question/Answer][1] $item_ship = new WC_Order_Item_Shipping(); $item_ship->set_name( "flat_rate" ); $item_ship->set_amount( $new_ship_price ); $item_ship->set_tax_class( '' ); $item_ship->set_tax_status( 'none' ); // Add Shipping item to the order $order->add_item( $item_ship ); But neither seem to