One the issues I'm seeing in making Commerce Migrate work for me is in getting the MigrateSQLMap Class to allow products from two separate imports to map to each other with just a SKU.
At present I am using the following mapping with the system of record mapping to the destination for updating existing products and a field mapping which points to another Migrate class which can be compared with
$this->map = new MigrateSQLMap(
$this->machineName,
array(
'Material' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
),
MigrateDestinationCommerceProduct::getKeySchema('commerce_product')
);
...
$this->systemOfRecord = Migration::DESTINATION;
...
$this->addFieldMapping('sku', 'Material')
->sourceMigration('ServiceKit');
In my other Migrate Map Class I am providing this:
$this->map = new MigrateSQLMap(
$this->machineName,
array(
'Part' => array(
'type' => 'varchar',
'length' => 255,
),
),
MigrateDestinationCommerceProduct::getKeySchema('commerce_product')
);
Parts and Materials are interchangeable. Materials will update certain fields of parts. That is to say if the system worked.
I know that MigrateDestinationCommerceProduct does not modify much of MigrateDestinationEntityAPI but what I would like to suggest is the opportunity to grab the product_id for the entity via a SKU rather than the default Migration Source Fields of product_id and revision_id.
I'm at a loss as to how to override the MigrateDestinationCommerceProduct Class in order to have a conditional pointer for the Mapping Class to be able to compare.
Any thoughts?
I know that there are others out there that are having this issue regarding product_id and revision_id mapping and updating. Please speak up!
I'm labeling this a bug report until we can get a concrete example as to how to compare and join two products that only have skus as their unique identifiers...
Closed: outdated
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.