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.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityHow 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.
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]);
+ }
Looking at the rest of the $dataRow manipulations that line does look odd.
Try replacing
875: $dataRow += $stockItemRows[$productId];
with
$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 is perfectly work for me. Thanks.
$dataRow = array_merge($dataRow,$stockItemRows[$productId]);