WordPress at Your Fingertips
function is not described

WC_Order_Item_Tax::set_rate() public WC 1.0

Set properties based on passed in tax rate by ID.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Order_Item_Tax = new WC_Order_Item_Tax();
$WC_Order_Item_Tax->set_rate( $tax_rate_id );
$tax_rate_id(int) (required)
Tax rate ID.

Code of WC_Order_Item_Tax::set_rate() WC 5.7.1

public function set_rate( $tax_rate_id ) {
	$tax_rate = WC_Tax::_get_tax_rate( $tax_rate_id, OBJECT );

	$this->set_rate_id( $tax_rate_id );
	$this->set_rate_code( WC_Tax::get_rate_code( $tax_rate ) );
	$this->set_label( WC_Tax::get_rate_label( $tax_rate ) );
	$this->set_compound( WC_Tax::is_compound( $tax_rate ) );
	$this->set_rate_percent( WC_Tax::get_rate_percent_value( $tax_rate ) );
}