WC_Shipping_Rate::set_cost()publicWC 3.2.0

Set rate cost.

{} It's a method of the class: WC_Shipping_Rate{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Shipping_Rate = new WC_Shipping_Rate();
$WC_Shipping_Rate->set_cost( $cost );
$cost(string) (required)
Shipping rate cost.

Changelog

Since 3.2.0 Introduced.

Code of WC_Shipping_Rate::set_cost() WC 6.7.0

public function set_cost( $cost ) {
	$this->data['cost'] = $cost;
}