wc_importer_shopify_special_mappings( array $mappings, array $raw_headers )

Add special wildcard Shopify mappings.


Description Description


Parameters Parameters

$mappings

(Required) Importer columns mappings.

$raw_headers

(Required) Raw headers from CSV being imported.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/admin/importers/mappings/shopify.php

function wc_importer_shopify_special_mappings( $mappings, $raw_headers ) {
	// Only map if this is looks like a Shopify export.
	if ( 0 !== count( array_diff( array( 'Title', 'Body (HTML)', 'Type', 'Variant SKU' ), $raw_headers ) ) ) {
		return $mappings;
	}
	$shopify_mappings = array(
		'Option%d Name'  => 'attributes:name',
		'Option%d Value' => 'attributes:value',
	);
	return array_merge( $mappings, $shopify_mappings );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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