firegento / FireGento_FastSimpleImport2

AvS_FastSimpleImport for Magento 2
GNU General Public License v3.0
136 stars 78 forks source link

Simple Product Import - Categories Field #13

Open techteamus opened 8 years ago

techteamus commented 8 years ago

Thank you for the module it is exactly what I am looking for.

Could we have clarification of the format of the categories field during simple product import.

For the other fields I have followed the guidelines as for a standard CSV import but when I try this with 'categories' things do not work out as expected. The Magento documentation gives this as an example:

Default Category/Gear|Default Category/Gear/Bags

More than one category can specified using the pipe "|" symbol to separate the category paths.

This does not work with the FireGento import, it took some experimentation to find out that the separator for category paths was "," which causes even more problems if you have comma's in the category names.

Once those issues were understood the simple product worked just fine creating the appropriate categories dynamically.

EliasKotlyar commented 8 years ago

Hello Techteamus,

I figured out a solution for that Problem, and integrated it into the module:

You can now pass the Field-Separator trough a extra Parameter. With this feature , you are able to change the default separator from "," to "|" or any other character.

Just call "setMultipleValueSeparator" on the Import Model, and you are good to go. I have tested it with categorys which include an "," and its working.

Greetings Elias

leptoquark1 commented 8 years ago

Sorry to push this issue, but I concern that in the M1 Module of firegento import I used the categoryIds in a nested array to set the categories for a product. In M2 module I set importmodel to nested arrays but in not seem to work that way anymore:

$adapterFactory = $this->getObjectManager()->create('FireGento\FastSimpleImport\Model\Adapters\NestedArrayAdapterFactory');
$this->getImporter()->setImportAdapterFactory($adapterFactory);

Do I have to set the value of 'categories' to the full path of the category as a string or is there a way to avoid this and use the id's again?

I realized a simular issue with the visibility that accept just comma seperated strings instead of the actually correct value that I have expected:

$productEntry[\Magento\Catalog\Model\Product::VISIBILITY] =        'Catalog, Search'; // works
$productEntry[\Magento\Catalog\Model\Product::VISIBILITY] =        \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH; //works not