Automattic\WooCommerce\Internal\CLI\Migrator\Platforms\Webflow

WebflowMapper::extract_dimensionsprivateWC 1.0

Extract Webflow SKU dimensions (length, width, height).

Webflow returns these as raw numerics with no associated unit on the SKU payload — the unit is a store-level setting on the Webflow side, with no API representation. We pass through as-is; WooCommerce will interpret them in whatever woocommerce_dimension_unit is configured for the destination store. Null/zero/non-numeric values are dropped.

Method of the class: WebflowMapper{}

No Hooks.

Returns

Array{length:. ?float, width: ?float, height: ?float}

Usage

// private - for code of main (parent) class only
$result = $this->extract_dimensions( $sku_field ): array;
$sku_field(object) (required)
SKU fieldData.

WebflowMapper::extract_dimensions() code WC 11.0.0

private function extract_dimensions( object $sku_field ): array {
	$dimensions = array(
		'length' => null,
		'width'  => null,
		'height' => null,
	);
	foreach ( array_keys( $dimensions ) as $key ) {
		if ( isset( $sku_field->{$key} ) && is_numeric( $sku_field->{$key} ) && (float) $sku_field->{$key} > 0 ) {
			$dimensions[ $key ] = (float) $sku_field->{$key};
		}
	}
	return $dimensions;
}