Magento Forum

   
Product Position in Categories lost on Import/Export
 
pabloboyle
Jr. Member
 
Total Posts:  2
Joined:  2012-10-17
 

I was making some edits to products using the Import/Export wizard.  I noticed that when I re-imported the products that the postition of the product within a category was changed from the values that were saved to a default value of 1.

This is the position that is viewable in the Magento Admin if you go into a category and then select category products.  After import the values were set to 1.

Is this a known fault or am I doing something wrong?

Thanks,
Paul

 
Magento Community Magento Community
Magento Community
Magento Community
 
davison
Member
 
Avatar
Total Posts:  56
Joined:  2011-09-11
 

Hi,

In my point of view there are some points to know while product position changes or lost while Import/Export,

1. Initially check for problem in the file : app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php, function _saveProductCategories()

2. However, then perform insertOnDuplicate(), and if the position for this category/product already specified, it replace the position with 1 as well.

3. To fix this issue, you may try for the following code this may help,

if ($categoriesIn) {
$this->;_connection->;insertOnDuplicate($tableName, $categoriesIn, array(’position’));
}

Replace it with the following

if ($categoriesIn) {
$this->_connection->insertOnDuplicate($tableName, $categoriesIn, array(’category_id’));
}

Please check it out and let me know

 
Magento Community Magento Community
Magento Community
Magento Community
 
pabloboyle
Jr. Member
 
Total Posts:  2
Joined:  2012-10-17
 

Thanks for your reply, I managed to get this working by using the profiles method of exporting/importing.  I was doing it previously using the standard import/export which didn’t seem to retain the category sort position attributes.
Paul

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top