Closed pquerner closed 10 years ago
This isn't a known bug. All input should be translated properly. Have you set the localization of your shop correctly?
I dont get what this import stuff has to do with localized country names. Why does this not work like customers country (where you have to give the country code, not the localized country name). Even if I have a german or english magento installation, I should be able to use the manufacturers country just like the customer country - per country code. Which doesnt care about localized country names, dont you agree ?
Agreed, I think there is a special case build in for the customer country codes: https://github.com/OpenMage/magento-mirror/blob/5345da52778cc6f5f31938ffd21fccfdd353435c/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php#L113
There should be a similar option for the country_of_manufacture field.
@pquerner Interested in building this functionality and creating a pull-request?
@paales I'm afraid I am fairly new to the magento world and therefore got no real talent developing on such things, but I might give it a shot when I got some space. Is there any direction you could point me to, perhaps?
Could you try and simply add it to:
protected $_indexValueAttributes = array('country_of_manufacture');
@paales So this is per se not an issue of this Modul but of Magento itself?
This is indeed a problem in the import functionality of Magento its self. The importer module is probably the most buggy code in Magento, so that's the reason this module exists (besides having the array option).
I see. I have created an magento issue ticket regarding that problem. http://www.magentocommerce.com/bug-tracking/issue/index/id/316
@pquerner Yeah, I give you a low chance of that ever getting fixed, but I guess it's good that you created it anyways. :smile:
Well I know this wont get a high priority on their part. ;) I still might try to find out if thats an easy fix and apply the patch myself. But we'll see.
@paales Can you explain this to me like I'm 5? Why did you just have to add the attribute to this array (and make it a local variable) to be able to use an "id" (in this case a country code as the id) in the import process?
@pquerner The $_indexValueAttributes
is originally defined in it's parent class and used somewhere in the code to use the index values, does that make sense?
I think I got it:
src/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
public function getAttributeOptions(Mage_Eav_Model_Entity_Attribute_Abstract $attribute, $indexValAttrs = array())
Defines what options to consider for an attribute.
If that one attribute is in that array _indexValueAttributes
the importer will look in the options "value" key. If its not in that array the importer will look in the options "label" key.
When importing Products with a "country_of_manufacture" value, I get this result:
I also tried "Austria" as value.
PHP Array:
Using Magento v1.9.0.1
In "Settings > General > General > Frontend > Allowed Countries" everything is selected.
I see theres "Österreich" in there (which is Austria in German) but I dont think thats quite the correct way that we have to that that country name in our main tongue?! (Maybe AvSSimpleImport reads the wrong country table this time?)