FireGento_FastSimpleImport2 icon indicating copy to clipboard operation
FireGento_FastSimpleImport2 copied to clipboard

Product position is reset to zero after product import/update

Open JoostWan opened this issue 5 years ago • 1 comments

When we run the import to update qty of products, the position of that product will be reset to zero in the category.

We use $this->setBehavior(Import::BEHAVIOR_ADD_UPDATE);

   $productStock[] = [
                        'sku' => $row[1],
                        'use_config_manage_stock' => 0,
                        'use_config_backorders' => 0,
                        'manage_stock' => 1,
                        'backorders' => 1,
                        'is_in_stock' => $stockStatus,
                        'levertijd' => $row[7],
                        'qty' => $qty
                    ];

I tested it also with the normal import function in the backend. Then the product position in the category will be the same and not reset to zero.

JoostWan avatar Jul 31 '19 11:07 JoostWan

I had the same problem today. After a long research I noticed on the import page the dropdown shows Add/Update but the behavior is append. If not ::BEHAVIOR_APPEND is used all affected entries in catalog_category_product are always deleted and then added again with position 0. For whatever reason.

look here: dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php

ReichhartTom avatar Jan 29 '21 17:01 ReichhartTom