WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Utilities

CartController::get_package_name() protected WC 1.0

Creates a name for a package.

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

Hooks from the method

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_package_name( $package, $index );
$package(array) (required)
Shipping package from WooCommerce.
$index(int) (required)
Package number.

Code of CartController::get_package_name() WC 5.8.0

protected function get_package_name( $package, $index ) {
	return apply_filters(
		'woocommerce_shipping_package_name',
		$index > 1 ?
			sprintf(
				/* translators: %d: shipping package number */
				_x( 'Shipping method %d', 'shipping packages', 'woocommerce' ),
				$index
			) :
			_x( 'Shipping method', 'shipping packages', 'woocommerce' ),
		$package['package_id'],
		$package
	);
}