WC_Order_Item_Shipping::set_shipping_rate()publicWC 1.0

Set properties based on passed in shipping rate object.

Method of the class: WC_Order_Item_Shipping{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Order_Item_Shipping = new WC_Order_Item_Shipping();
$WC_Order_Item_Shipping->set_shipping_rate( $shipping_rate );
$shipping_rate(WC_Shipping_Rate) (required)
Shipping rate to set.

WC_Order_Item_Shipping::set_shipping_rate() code WC 9.4.2

public function set_shipping_rate( $shipping_rate ) {
	$this->set_method_title( $shipping_rate->get_label() );
	$this->set_method_id( $shipping_rate->get_method_id() );
	$this->set_instance_id( $shipping_rate->get_instance_id() );
	$this->set_total( $shipping_rate->get_cost() );
	$this->set_taxes( $shipping_rate->get_taxes() );
	$this->set_meta_data( $shipping_rate->get_meta_data() );
}