diff --git a/src/app/code/community/AvS/FastSimpleImport/Helper/Data.php b/src/app/code/community/AvS/FastSimpleImport/Helper/Data.php index 159b3c96..3070fa79 100644 --- a/src/app/code/community/AvS/FastSimpleImport/Helper/Data.php +++ b/src/app/code/community/AvS/FastSimpleImport/Helper/Data.php @@ -10,4 +10,23 @@ */ class AvS_FastSimpleImport_Helper_Data extends Mage_Core_Helper_Abstract -{} +{ + + /** + * Returns str with all alphabetic characters converted to lowercase. + * Uses the multibyte function variants if available. + * + * @param $str the string being lowercased + * + * @return string str with all alphabetic characters converted to lowercase + */ + public function strtolower($str) + { + if (function_exists('mb_strtolower') && function_exists('mb_detect_encoding')) { + return mb_strtolower($str, mb_detect_encoding($str)); + } + + return strtolower($str); + } + +} diff --git a/src/app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product.php b/src/app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product.php index dd3aa133..3c58610c 100644 --- a/src/app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product.php +++ b/src/app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product.php @@ -285,7 +285,9 @@ protected function _createDropdownAttributeOptions() $options = $this->_getAttributeOptions($attribute); - if (!in_array(trim($rowData[$attributeCode]), $options, true)) { + /** @var AvS_FastSimpleImport_Helper_Data $helper */ + $helper = Mage::helper('fastsimpleimport'); + if (!in_array($helper->strtolower(trim($rowData[$attributeCode])), $options, true)) { $this->_createAttributeOption($attribute, trim($rowData[$attributeCode])); } } @@ -318,7 +320,9 @@ protected function _createMultiselectAttributeOptions() $options = $this->_getAttributeOptions($attribute); - if (!in_array(trim($rowData[$attributeCode]), $options, true)) { + /** @var AvS_FastSimpleImport_Helper_Data $helper */ + $helper = Mage::helper('fastsimpleimport'); + if (!in_array($helper->strtolower(trim($rowData[$attributeCode])), $options, true)) { $this->_createAttributeOption($attribute, trim($rowData[$attributeCode])); } } @@ -346,7 +350,8 @@ protected function _getAttributeOptions($attribute) $this->_attributeOptions[$attribute->getAttributeCode()] = array(); foreach ($attributeOptions->getAllOptions(false) as $option) { - $this->_attributeOptions[$attribute->getAttributeCode()][$option['value']] = $option['label']; + $label = Mage::helper('fastsimpleimport')->strtolower($option['label']); + $this->_attributeOptions[$attribute->getAttributeCode()][$option['value']] = $label; } }