WC_Shipping_Method::get_rate_id( string $suffix = '' )

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


Description Description


Parameters Parameters

$suffix

(Optional) Suffix.

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/abstracts/abstract-wc-shipping-method.php

	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 );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.