cancel
Showing results for 
Search instead for 
Did you mean: 

Associated product image type unset after saving parent configurable product.

Associated product image type unset after saving parent configurable product.

I am using Magento 1.9.3.6 and using a slightly modified theme call blacknwhite from theme forest.

 

We have a configurable product which has a few color variations to it that is setup with images on all the simple products along with some price variations. We are setting this product up to work with the configurable swatches which allow updating of the product image based on the user selection. 

 

Everything works fine until a change is made on the parent configurable product. As soon as the configurable product is saved all the image type selections, such as which image is the base image and which is the small image, get undone and "no image" is selected on all the associated products. I can kind of work around this by going back into all the simple products individually and setting the base image desired and saving them. However if any change happens on the parent configurable product all the image selections are undone again and there are hundreds of products on the site.

 

We are using several 3rd party plugins, however after disabling all of them from the advanced section of the admin panel, nothing changes. My hunch is that there is some sort of db overwrite that is happening but i have no idea where to look for this.

 

What could be causing this issue? 

 

 

8 REPLIES

Re: Associated product image type unset after saving parent configurable product.

Hi @Joshisfame,

 

Can you activate your Magento logs to try to find if there's an error with code or data?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Associated product image type unset after saving parent configurable product.

I should have made it clear upfront, there have not been any errors generated in the system.log or exceptions.log or anywhere else for that matter. 

I did get curious though as i was double checking those files and decided to check to see if it was messing up any other information besides the images selections and it turns out that it is. If i go to the associated product tab and edit one of the simple associated products to have a new name, as soon as i save the configurable parent product, it reverts the name change back to what it was before. It almost like the configurable product is stuck in an old state or something.

 

 

Re: Associated product image type unset after saving parent configurable product.

I actually deleted the system.log and ran some changes again so I didnt have to filter through the large file and found these errors in there.

 

2017-10-25T13:30:11+00:00 ERR (3): Warning: array_merge(): Argument #1 is not an array  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
2017-10-25T13:30:11+00:00 ERR (3): Warning: in_array() expects parameter 2 to be array, null given  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 345
2017-10-25T13:30:19+00:00 ERR (3): Warning: array_merge_recursive() expects at least 1 parameter, 0 given  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 336
2017-10-25T13:30:19+00:00 ERR (3): Warning: array_unique() expects parameter 1 to be array, null given  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 337
2017-10-25T13:30:19+00:00 ERR (3): Warning: array_map(): Argument #2 should be an array  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
2017-10-25T13:30:19+00:00 ERR (3): Warning: array_merge(): Argument #1 is not an array  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
2017-10-25T13:30:19+00:00 ERR (3): Warning: in_array() expects parameter 2 to be array, null given  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 345
2017-10-25T13:30:19+00:00 ERR (3): Warning: array_merge_recursive() expects at least 1 parameter, 0 given  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 336
2017-10-25T13:30:19+00:00 ERR (3): Warning: array_unique() expects parameter 1 to be array, null given  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 337
2017-10-25T13:30:19+00:00 ERR (3): Warning: array_map(): Argument #2 should be an array  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
2017-10-25T13:30:19+00:00 ERR (3): Warning: array_merge(): Argument #1 is not an array  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 340
2017-10-25T13:30:19+00:00 ERR (3): Warning: in_array() expects parameter 2 to be array, null given  in /home/barnes/public_html/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 345

Re: Associated product image type unset after saving parent configurable product.

Hi @Joshisfame,

 

Can you share your Swatches configuration?
I got a few stores using this feature and can't reproduce the problem.

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Associated product image type unset after saving parent configurable product.

swatch-config.png

The only attribute selected to be used for swatches right now is color.

 

Is this the information you need? 

I am honestly unsure about where to look for the solution to this issue so im sorry if this information isn't enough or if it is incorrect.

 

Re: Associated product image type unset after saving parent configurable product.

Hi @Joshisfame,

 

I've tested your configuration and everyhtings works fine.

To be honest, I don't know how to reproduce the error.

Some comments:

 

  1. Which version of PHP are you using?
  2. Can you disable 3rd-party modules?
  3. Is it possible for you to test with a vanilla installation into the same environment to see if the instance code you're using is the problem?
--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Associated product image type unset after saving parent configurable product.

Ok so here are some details about the setup:

 

Server Config: the server is a shared server.

- Apache 2.4.25

- PHP 5.6.30 (can modify this if needed)

- MYSQL 5.6.37

 

running the following list of php extensions:

bcmath

dba

dom

enchant

fileinfo

gd

imap

intl

ioncube_loader

json

mbstring

mcrypt

mysql

mysqli

mysqlnd

odbc

opcache

pdo

pdo_mysql

pdo_odbc

pdo_pgsql

pdo_sqlite

pgsql

phar

posix

pspell

soap

sockets

sourceguardian

tidy

timezonedb

wddx

xmlreader

xmlrpc

xmlwriter

xsl

zend_guard_loader

zip

 

Magento version 1.9.3.6

 

Third party plugins shouldnt matter as long as i disable them all from Sytem>Configuration>Advanced>Advanced>Disable Modules Output section of the admin area correct?

 

Also i did a fresh install of magento 1.9.3.6 on the same server with the same theme and everything works fine.

 

Perhaps the issue is that the installation that is not working was updated from 1.9.3.2 to 1.9.3.6 via Softaculous and something subtle went wrong during that update...

Re: Associated product image type unset after saving parent configurable product.

Hi @Joshisfame,

 

Maybe there is something related with the upgrade.

The only detail I can remember right now about problems with configurabel swatches after upgrade is this: https://magento.stackexchange.com/questions/142404/configurable-swatches-not-working-after-1-9-3-upg...

 

Maybe you can check it too?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"