Skip to content

Instantly share code, notes, and snippets.

@Stasevi4
Stasevi4 / ProductimgFix.patch
Last active June 22, 2018 05:58
Magento Fix Undefined index - app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 145
diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
index 13e8659..f7000df 100755
--- a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
+++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
@@ -141,12 +141,12 @@ class Mage_ConfigurableSwatches_Helper_Productimg extends Mage_Core_Helper_Abstr
$swatchLabel = $label . self::SWATCH_LABEL_SUFFIX;
$imageKeys[$label] = array_search($label, $imageHaystack);
- if ($imageKeys[$label] === false) {
+ if ($imageKeys[$label] === false && array_keys($mapping, $label)) {