Product attribute option lookup is not case sensitive
Hello
I have the privilege of working with your awesome module again, and I just want to start off by saying Thank You!! If you are ever in Cape Town, South Africa, please please get in touch because I would want to buy you a few beers :)
I have a small issue with the code, and that is that it's not validating attribute options based on casing An example: We have an attribute Size, and an option of that 12 Years. I would like to make that case sensitive, so that when we import "12 years" it would validate and say that that option does not exist. Currently that passes.
This leads onto a bigger problem, unfortunately.
I am using that Size to create the simple product SKU. But what is happening is that I would have a simple product in magento with sku "ABC-12 Years" and when this case manifests, with the import, there would be another simple product created with SKU "ABC-12 years" That is strange right?
I tried to do that in the Magento admin and it failed validation saying that this SKU already exists. But, for some reason with the importer that is not happening.
Can you please point me in the right direction?
Thank you so much!!
Winston
I believe we just tackled this: https://github.com/avstudnitz/AvS_FastSimpleImport/pull/289
HI @paales
Thank you so much for the reply! I looked at that code, but the issue is, I think, occurring at a different place.
Essentially, I end up with this: OLD SKU: 44715-0006-12 Years NEW SKU: 44715-0006-12 years <--- note the lower case "y"
Somehow, that new sku is created, but it shouldn't. Inside the Magento Admin that action would fail, but with Import/Export it passes.
I don't want that new product. I wanted to simply update the old product.
I feel it's happening here: app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product.php
// 1. Entity phase
if (isset($this->_oldSku[$rowSku])) { // existing row
$entityRowsUp[] = array(
'updated_at' => now(),
'entity_id' => $this->_oldSku[$rowSku]['entity_id']
);
} else { // new row
But I'm not sure. I'm looking for a way to curb this behaviour
Let's say you have SKU1 in the DB and sku1 in the import set. It looks like fastsimpleimport goes:
- fetch sku1 -> mysql gets SKU1 (as it's case insensitive)
- this is stored in _oldSku['SKU1']
- later, the code looks for _oldSku['sku1'] and doesn't find it, because array lookups ARE case sensitive.
However, I can't find where _oldSku is populated.