1

I am importing ~5000 products into our Magento 1.9 via Magmi 0.7.22 without major issues. The categories shall not be active so I set the is_active flag in the categories column to 0:

[myroot]/CatA1::0::1::1/CatA2::0::1::1;;[myroot]/CatB1::0::1::1/CatB2::0::1::1

According to the documentation of the CategoryImporter plugin the syntax is as follows:

[root category]/category name::[is_active]::[is_anchor]::[include_in_menu]

But all categories which are created during the import are active. Am I doing something wrong here?

1 Answer 1

0

Seems I hit a known bug, which was already reported in Magmi's tracker: https://sourceforge.net/p/magmi/bugs/67/

Magmi needs to remove the "position" attribute for some reason, which is separated with "::", just as the other attributes. All category attributes are optional. The bug is now that all attributes are removed instead of only the "position" attribute.

The code repository at SourceForge is quite inactive, so I decided to work around the bug myself in a way that I would need a different value separator for the "position" attribute (actually I don't need the positioning). In plugins/extra/itemprocessors/categories/categoryimport.php, I modified the explode() separator in line 205:

Before:

foreach ($pcatparts as $cp) {
    $a = explode("::", $cp);
    $catparts[] = $a[0];
    $catpos[] = (count($a) > 1 ? $a[1] : "0");
    // remove position to build catpart array
}

After:

foreach ($pcatparts as $cp) {
    $a = explode(":P:", $cp);
    $catparts[] = $a[0];
    $catpos[] = (count($a) > 1 ? $a[1] : "0");
    // remove position to build catpart array
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.