Configurable Product Dropdown Image SwitchConfigurable products: product image not updating after selecting attribute in dropdownFatal Error Mediafallback.php on line 61How to correctly create a configurable product with multiple attributes and imagesHow to display Configurable/Color Swatches in Homepage Magento 1.9.1Magento - Fatal Error in Mediafallback.php - 1.9.2.4Configurable product image resolution issueIssue while Configuring color swatches in Magento 1.9.3.10How to show dropdown configurable attribute in Product Category View in Magento 2?Fatal error: Uncaught Error: Call to a member function getId() on null inProductimg.php errorlog in system.logMagento 1 EE 1.14.3.10 - Mage::getSingleton('core/resource')->getConnection('core_read') is returning null sometimes

Is it ok to include an epilogue dedicated to colleagues who passed away in the end of the manuscript?

Replacing Windows 7 security updates with anti-virus?

Force user to remove USB token

Is "history" a male-biased word ("his+story")?

Potentiometer like component

How is the Swiss post e-voting system supposed to work, and how was it wrong?

US to Europe trip with Canada layover- is 52 minutes enough?

Good allowance savings plan?

What is the probability somebody's birthday is the day before mine?

How could our ancestors have domesticated a solitary predator?

How to deal with a cynical class?

Can the druid cantrip Thorn Whip really defeat a water weird this easily?

Is a lawful good "antagonist" effective?

Does the Bracer of Flying Daggers benefit from the Dueling Fighting style?

Too much vertical space above xrightarrow

Plywood subfloor won't screw down in a trailer home

How does airport security verify that you can carry a battery bank over 100 Wh?

What exactly is the purpose of connection links straped between the rocket and the launch pad

Gravity alteration as extermination tool viable?

It's a yearly task, alright

Is going from continuous data to categorical always wrong?

What happens with multiple copies of Humility and Glorious Anthem on the battlefield?

A curious inequality concerning binomial coefficients

The three point beverage



Configurable Product Dropdown Image Switch


Configurable products: product image not updating after selecting attribute in dropdownFatal Error Mediafallback.php on line 61How to correctly create a configurable product with multiple attributes and imagesHow to display Configurable/Color Swatches in Homepage Magento 1.9.1Magento - Fatal Error in Mediafallback.php - 1.9.2.4Configurable product image resolution issueIssue while Configuring color swatches in Magento 1.9.3.10How to show dropdown configurable attribute in Product Category View in Magento 2?Fatal error: Uncaught Error: Call to a member function getId() on null inProductimg.php errorlog in system.logMagento 1 EE 1.14.3.10 - Mage::getSingleton('core/resource')->getConnection('core_read') is returning null sometimes













0















I upgraded my site from EE 1.14.1.0 to 1.14.3.10 and now when I navigate to a configurable product that uses a drop down (not swatches) to change the image, the image does not change.



I have looked at the solutions in these exchanges, but none of them solved my issue:



Configurable products: product image not updating after selecting attribute in dropdown



^ This solution while it technically solves my problem, it doesn't keep the options in a dropdown, but switches them to swatches. We want the options to remain in a dropdown.



https://stackoverflow.com/questions/41845427/typeerror-product-configurableswatches-is-not-a-constructor-in-magento-1-9-3



^ This solution solves a JS error I also got, but doesn't fix the images switching part.



--



As soon as I navigate to the page, these errors are generated in system.log:



ERR (3): Warning: array_merge_recursive() expects at least 1 parameter, 0 given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 336
ERR (3): Warning: array_unique() expects parameter 1 to be array, null given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 337
ERR (3): Warning: array_map(): Argument #2 should be an array in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
ERR (3): Warning: array_merge(): Argument #1 is not an array in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
ERR (3): Warning: in_array() expects parameter 2 to be array, null given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 345


Could this be what is causing the issue? If so, what might a solution be?



This was not an issue prior to updating. I have a support ticket out with Magento, but they are taking their sweet time (since November), so I thought I would see if anyone has any solutions.



--



Update 3/12



Magento sent me a patch that resolved the errors in system.log, but I am still unable to swap images based on the option selected in the dropdown.



In app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php update the filterImageInGallery function as follows:



public function filterImageInGallery($product, $image)

if (!Mage::helper('configurableswatches')->isEnabled())
return true;


if (!isset($this->_productImageFilters[$product->getId()])
&& $childAttributeLabelMapping = $product->getChildAttributeLabelMapping()
)
$mapping = call_user_func_array("array_merge_recursive", $childAttributeLabelMapping);
$filters = array_unique($mapping['labels']);
$filters = array_merge($filters, array_map(function ($label)
return $label . Mage_ConfigurableSwatches_Helper_Productimg::SWATCH_LABEL_SUFFIX;
, $filters));
$this->_productImageFilters[$product->getId()] = $filters;

return !in_array(Mage_ConfigurableSwatches_Helper_Data::normalizeKey($image->getLabel()),
$this->_productImageFilters[$product->getId()]);


return true;










share|improve this question




























    0















    I upgraded my site from EE 1.14.1.0 to 1.14.3.10 and now when I navigate to a configurable product that uses a drop down (not swatches) to change the image, the image does not change.



    I have looked at the solutions in these exchanges, but none of them solved my issue:



    Configurable products: product image not updating after selecting attribute in dropdown



    ^ This solution while it technically solves my problem, it doesn't keep the options in a dropdown, but switches them to swatches. We want the options to remain in a dropdown.



    https://stackoverflow.com/questions/41845427/typeerror-product-configurableswatches-is-not-a-constructor-in-magento-1-9-3



    ^ This solution solves a JS error I also got, but doesn't fix the images switching part.



    --



    As soon as I navigate to the page, these errors are generated in system.log:



    ERR (3): Warning: array_merge_recursive() expects at least 1 parameter, 0 given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 336
    ERR (3): Warning: array_unique() expects parameter 1 to be array, null given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 337
    ERR (3): Warning: array_map(): Argument #2 should be an array in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
    ERR (3): Warning: array_merge(): Argument #1 is not an array in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
    ERR (3): Warning: in_array() expects parameter 2 to be array, null given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 345


    Could this be what is causing the issue? If so, what might a solution be?



    This was not an issue prior to updating. I have a support ticket out with Magento, but they are taking their sweet time (since November), so I thought I would see if anyone has any solutions.



    --



    Update 3/12



    Magento sent me a patch that resolved the errors in system.log, but I am still unable to swap images based on the option selected in the dropdown.



    In app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php update the filterImageInGallery function as follows:



    public function filterImageInGallery($product, $image)

    if (!Mage::helper('configurableswatches')->isEnabled())
    return true;


    if (!isset($this->_productImageFilters[$product->getId()])
    && $childAttributeLabelMapping = $product->getChildAttributeLabelMapping()
    )
    $mapping = call_user_func_array("array_merge_recursive", $childAttributeLabelMapping);
    $filters = array_unique($mapping['labels']);
    $filters = array_merge($filters, array_map(function ($label)
    return $label . Mage_ConfigurableSwatches_Helper_Productimg::SWATCH_LABEL_SUFFIX;
    , $filters));
    $this->_productImageFilters[$product->getId()] = $filters;

    return !in_array(Mage_ConfigurableSwatches_Helper_Data::normalizeKey($image->getLabel()),
    $this->_productImageFilters[$product->getId()]);


    return true;










    share|improve this question


























      0












      0








      0








      I upgraded my site from EE 1.14.1.0 to 1.14.3.10 and now when I navigate to a configurable product that uses a drop down (not swatches) to change the image, the image does not change.



      I have looked at the solutions in these exchanges, but none of them solved my issue:



      Configurable products: product image not updating after selecting attribute in dropdown



      ^ This solution while it technically solves my problem, it doesn't keep the options in a dropdown, but switches them to swatches. We want the options to remain in a dropdown.



      https://stackoverflow.com/questions/41845427/typeerror-product-configurableswatches-is-not-a-constructor-in-magento-1-9-3



      ^ This solution solves a JS error I also got, but doesn't fix the images switching part.



      --



      As soon as I navigate to the page, these errors are generated in system.log:



      ERR (3): Warning: array_merge_recursive() expects at least 1 parameter, 0 given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 336
      ERR (3): Warning: array_unique() expects parameter 1 to be array, null given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 337
      ERR (3): Warning: array_map(): Argument #2 should be an array in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
      ERR (3): Warning: array_merge(): Argument #1 is not an array in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
      ERR (3): Warning: in_array() expects parameter 2 to be array, null given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 345


      Could this be what is causing the issue? If so, what might a solution be?



      This was not an issue prior to updating. I have a support ticket out with Magento, but they are taking their sweet time (since November), so I thought I would see if anyone has any solutions.



      --



      Update 3/12



      Magento sent me a patch that resolved the errors in system.log, but I am still unable to swap images based on the option selected in the dropdown.



      In app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php update the filterImageInGallery function as follows:



      public function filterImageInGallery($product, $image)

      if (!Mage::helper('configurableswatches')->isEnabled())
      return true;


      if (!isset($this->_productImageFilters[$product->getId()])
      && $childAttributeLabelMapping = $product->getChildAttributeLabelMapping()
      )
      $mapping = call_user_func_array("array_merge_recursive", $childAttributeLabelMapping);
      $filters = array_unique($mapping['labels']);
      $filters = array_merge($filters, array_map(function ($label)
      return $label . Mage_ConfigurableSwatches_Helper_Productimg::SWATCH_LABEL_SUFFIX;
      , $filters));
      $this->_productImageFilters[$product->getId()] = $filters;

      return !in_array(Mage_ConfigurableSwatches_Helper_Data::normalizeKey($image->getLabel()),
      $this->_productImageFilters[$product->getId()]);


      return true;










      share|improve this question
















      I upgraded my site from EE 1.14.1.0 to 1.14.3.10 and now when I navigate to a configurable product that uses a drop down (not swatches) to change the image, the image does not change.



      I have looked at the solutions in these exchanges, but none of them solved my issue:



      Configurable products: product image not updating after selecting attribute in dropdown



      ^ This solution while it technically solves my problem, it doesn't keep the options in a dropdown, but switches them to swatches. We want the options to remain in a dropdown.



      https://stackoverflow.com/questions/41845427/typeerror-product-configurableswatches-is-not-a-constructor-in-magento-1-9-3



      ^ This solution solves a JS error I also got, but doesn't fix the images switching part.



      --



      As soon as I navigate to the page, these errors are generated in system.log:



      ERR (3): Warning: array_merge_recursive() expects at least 1 parameter, 0 given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 336
      ERR (3): Warning: array_unique() expects parameter 1 to be array, null given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 337
      ERR (3): Warning: array_map(): Argument #2 should be an array in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
      ERR (3): Warning: array_merge(): Argument #1 is not an array in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
      ERR (3): Warning: in_array() expects parameter 2 to be array, null given in /app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 345


      Could this be what is causing the issue? If so, what might a solution be?



      This was not an issue prior to updating. I have a support ticket out with Magento, but they are taking their sweet time (since November), so I thought I would see if anyone has any solutions.



      --



      Update 3/12



      Magento sent me a patch that resolved the errors in system.log, but I am still unable to swap images based on the option selected in the dropdown.



      In app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php update the filterImageInGallery function as follows:



      public function filterImageInGallery($product, $image)

      if (!Mage::helper('configurableswatches')->isEnabled())
      return true;


      if (!isset($this->_productImageFilters[$product->getId()])
      && $childAttributeLabelMapping = $product->getChildAttributeLabelMapping()
      )
      $mapping = call_user_func_array("array_merge_recursive", $childAttributeLabelMapping);
      $filters = array_unique($mapping['labels']);
      $filters = array_merge($filters, array_map(function ($label)
      return $label . Mage_ConfigurableSwatches_Helper_Productimg::SWATCH_LABEL_SUFFIX;
      , $filters));
      $this->_productImageFilters[$product->getId()] = $filters;

      return !in_array(Mage_ConfigurableSwatches_Helper_Data::normalizeKey($image->getLabel()),
      $this->_productImageFilters[$product->getId()]);


      return true;







      configurable-product configurable-swatches magento-1.14.3.10






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago







      cbartell

















      asked Mar 6 at 18:55









      cbartellcbartell

      65




      65




















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f264761%2fconfigurable-product-dropdown-image-switch%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f264761%2fconfigurable-product-dropdown-image-switch%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

          Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр

          Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»