Im making a import for a client using Magmi. and the weirdest thing is happening.
Imagine a list of products by SKU
sku1
sku2
sku3
when the import is finished it looks like this
sku1
sku1
sku3
i have no idea why this is happening and why Magmi is changing the SKU of a product
In real life [sku::301e-1204] is changed to [sku::601E-4123]
First stage is to read product.xml and below is the result of one product
[sku] => 301e-1204
[price] => 39.9500
[ecommerce_guid] => 29C6C1E8-06FC-4C52-A652-002D1DBA8A78
[product_variation_id] => 147146-7970
Second stage is to read stock.xml and below is the result of one product
[sku] => 301e-1204
[qty] => 1
[use_config_manage_stock] => 1
[is_in_stock] => 1
this is the function that injects it into magento database
public function importProduct($product)
{
$this->magmi->ingest($product);
print_r($product);
}
the array results you see are produced by the print_r($product); line
i think the problem comes from sku value interpretation. It has been fixed in latest git however.
in comparison operators, your 2 skus would match equality !!!
See this snippet:
<?php
$x="301e-1204";
$y="601e-4312";
echo "$x/$y=>".($x==$y?"Y":"N");
?>
It would echo "Y" at the end. In fact, PHP takes those as "numbers" (since XeY is a valid numerical notation) if using "relax" comparison operator "==". This doesn't happend with strict comparison (===)
nor strcmp.
this sku comparison code has been fixed for a while now in latest Git see this Git Commit.
Try latest git version, it has many bugfixes & enhancements. It should fix your problem.