1

Two categories on my website mrmobileuk.com are showing the following error:

Fatal error: Unsupported operand types in app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php on line 61

These are the categories:

http://mrmobileuk.com/index.php/lcds-digitizers-spare-parts.html

http://mrmobileuk.com/index.php/lcds-digitizers-spare-parts/spare-parts.html

Rest other categories are fine.

There have been posts on this issue previously too on your site but no recommended solution has been posted in response.


@murtaza and rest who have been following this post.

There was no problem with the Mediafallback.php file.

Do not edit the core file.

I created new categories and tried to place the products in these new categories one by one. The error showed up again after moving a certain product which was the main cause. It was a configurable product but it wasn't associated with simple products. So I deleted that product and created again and was all fine after that. Because of that, the whole category was showing an error. I still do not know why that product was causing an error but deleting it solved the issue. So if you are keen to know why, you can investigate on that part.

2
  • Which Magento version are you using exactly ? Mar 8, 2017 at 15:13
  • @Rahphael Am using 1.9.2.4
    – sash
    Mar 9, 2017 at 9:50

1 Answer 1

0

copy

Magento_Base_DIR/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php

to

Magento_Base_DIR/app/code/local/Mage/ConfigurableSwatches/Helper/Mediafallback.php

and change line number 61 from

$optionLabels += $attribute->getOptionLabels();

to

$optionLabels .= $attribute->getOptionLabels();

this is how I solve this error.

Edit

$optionLabels = $optionLabels + $attribute->getOptionLabels();

Edit2

 $optionLabels = array_merge($optionLabels , $attribute->getOptionLabels());
17
  • @Murtaza There is no ConfigurableSwatches folder in Magento_Base_DIR/app/code/local/Mage/ - Do you want me to copy whole folder in to that?
    – sash
    Mar 9, 2017 at 10:08
  • @sash create one folder and paste that php file and then change the code in local code pool Mar 9, 2017 at 10:10
  • @Murtaza I created the folder and edited the file - it worked - but the swatch icons are not showing up now - they are showing an image instead of the colors - mrmobileuk.com/index.php/protection/tablet-protection/…
    – sash
    Mar 9, 2017 at 10:22
  • @sash try edit line instead of previous Mar 9, 2017 at 10:31
  • @Murtaza That brought the swatch icons back but the error is back again too - mrmobileuk.com/index.php/lcds-digitizers-spare-parts.html
    – sash
    Mar 9, 2017 at 10:37

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