How can I solve this :

Unsupported operand types in C:\wamp\www\abc\app\code\core\Mage\ImportExport\Model\Export\Entity\Product.php on line 875

It occurs when trying to export products via the admin panel system -> import/export menu.

  • What version of php are you running? Apr 28 '16 at 8:25
  • my current php version 5.5.12
    – Gem
    Apr 28 '16 at 8:41
  • scrap my answer then...:) What version of Magento is it? Apr 28 '16 at 8:44
  • magento
    – Gem
    Apr 28 '16 at 8:47
  • that line does stand out as being different to all the others in that function so have posted an answer I think will work as a fix. Apr 28 '16 at 8:58

Magento have a patch for this issue as SUPEE-6511.

Ask magento support for the official patch file, however the change provided is simple enough. Around line 875-ish in app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php you should update as follows.

-    $dataRow += $stockItemRows[$productId];
+    if (isset($stockItemRows[$productId])) {
+        $dataRow = array_merge($dataRow, $stockItemRows[$productId]);
+    }
  • Where can we find the official patch file for SUPEE-6511? We are having the same issue on CE which doesn't offer Magento support. However, I would prefer to have the official patch on file if there is one. Sep 15 '16 at 16:47
  • No official patch on hand sorry. Magento only generally hand out security patches. The only other source of patches would be github.com/brentwpeterson/magento-patches Sep 15 '16 at 22:41
  • Fix mentioned here is correct, but issue still exists in github.com/firegento/magento/blob/… Feb 7 '18 at 14:58
  • Thanks, I confirm that it worked from my end using Magento Sep 23 '19 at 5:32

Looking at the rest of the $dataRow manipulations that line does look odd.

Try replacing

875:    $dataRow += $stockItemRows[$productId];


$dataRow = array_merge($dataRow,$stockItemRows[$productId]);

However, directly modifying core files is bad so you should override it but a quick test should show if it is working.


Assuming that the problem line (as you didn't specify your Magento version) looks something like this:

875:    $dataRow += $stockItemRows[$productId];

My first thing to check would be the version of php you are using. I do not think that, for pre PHP v5.2 (and some of v5.2...), the += operand is not supported for arrays, which this action is.


This worked great: $dataRow = array_merge($dataRow,$stockItemRows[$productId]);


This is perfectly work for me. Thanks.

$dataRow = array_merge($dataRow,$stockItemRows[$productId]);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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