WordPress at Your Fingertips
function is not described

WC_Shipping_Method::get_rate_id() public WC 2.6.0

Returns a rate ID based on this methods ID and instance, with an optional suffix if distinguishing between multiple rates.

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

No Hooks.

Return

String.

Usage

$WC_Shipping_Method = new WC_Shipping_Method();
$WC_Shipping_Method->get_rate_id( $suffix );
$suffix(string)
Suffix.
Default: ''

Changelog

Since 2.6.0 Introduced.

Code of WC_Shipping_Method::get_rate_id() WC 5.8.0

public function get_rate_id( $suffix = '' ) {
	$rate_id = array( $this->id );

	if ( $this->instance_id ) {
		$rate_id[] = $this->instance_id;
	}

	if ( $suffix ) {
		$rate_id[] = $suffix;
	}

	return implode( ':', $rate_id );
}