Skip to content
This repository has been archived by the owner on Apr 29, 2019. It is now read-only.

Products are not getting replaced because of the strtolower function on fetching sku from the database #118

Open
NoorulBhoelai opened this issue Jul 24, 2018 · 2 comments

Comments

@NoorulBhoelai
Copy link

NoorulBhoelai commented Jul 24, 2018

While importing new simple products with a capital alpha character postfix, existing simple product will not get replaced because of the strtolower($sku) function when fetching SKU's from the database.

Preconditions

  1. Magento version 2.2.3

Steps to reproduce

  1. import product with sku 11111M
  2. run import again with sku 11111M

Expected result

View catalog_product_entity table and you will find the sku 11111M product being copied instead of being replaced.

Function of the strtolower on SKU

\Magento\CatalogImportExport\Model\Import\Product\SkuProcessor::getNewSku line 144

@paales
Copy link
Contributor

paales commented Jul 25, 2018

Few discussion points we had internally:

  • It would be best if SKU would be case-sensitive and if it would support all characters possible. This way we give more freedom to the merchant and they can create SKU's in any format. Having that said, we understand that his will be a big change.

  • Removing the strtolower functionality wasn't as easy as it looked, because it is used in a lot of classes.

    • \Magento\CatalogImportExport\Model\Import\Product\SkuProcessor::_getSkus
    • \Magento\CatalogImportExport\Model\Import\Product::_saveProductAttributes
    • \Magento\BundleImportExport\Model\Import\Product\Type\Bundle::saveData:363
    • \Magento\ConfigurableImportExport\Model\Import\Product\Type\Configurable::configurableInBunch:804
    • \Magento\ConfigurableImportExport\Model\Import\Product\Type\Configurable::saveData:773
    • \Magento\DownloadableImportExport\Model\Import\Product\Type\Downloadable::saveData:288
  • It seems the ImportExport is missing some strtolower method somewhere, but we couldn't find the exact location.

@dmanners
Copy link
Contributor

Hello,

Thank you for raising this issue. We are currently investigating this and more issues with regards to SKU look ups under the issue #37 I would like to combine these issues if that makes sense.

@tadhgbowe is this case being covered in your issue validation?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants