# packeta/2.3.2/src/PacketaWidget/getShippingMethodOptionId.js

Packeta, version 2.3.2. 9 lines.

- Page: https://pluginprobe.com/plugins/packeta/2.3.2/code/src/PacketaWidget/getShippingMethodOptionId.js
- Raw: https://pluginprobe.com/plugins/packeta/2.3.2/raw/src/PacketaWidget/getShippingMethodOptionId.js
- Modified: 2025-03-10T10:47:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/packeta/2.3.2/code/src/PacketaWidget/getShippingMethodOptionId.js#L10-L20`.

```javascript
export const getShippingMethodOptionId = function ( rateId ) {
	if ( rateId.startsWith( 'packeta_method_' ) ) {
		const [ methodId, instanceId ] = rateId.split( ':' );
		return 'packetery_carrier_' + methodId.replace( 'packeta_method_', '' );
	}

	return rateId.replace( 'packetery_shipping_method:', '' );
};

```
