November 17, 2019

cm-mini

Thinking Magento

Configurable Product Is Creating A Simple Associated Product, But Ajax Loader Remains Spinning

As the title suggests for this one, this is an error you might have been receiving when you try and add associated products to a configurable product, however all that happens on the configurable screen is the spinning ajax wheel telling you it's loading.

The simple product is created correctly, however the screen for the configurable product does not update, your only option being to refresh the page.

I found this error was down to an update I made to combat against the Core_Url_Rewrite bug.

One solution had been to change the following code in 

app/code/core/Mage/Catalog/Model/Url.php 

Change:

if ($product->getUrlKey() == '' && !empty($requestPath) && strpos($existingRequestPath, $requestPath) === 0 ) 

To:

if (!empty($requestPath) && strpos($existingRequestPath, $requestPath) === 0 ) 

This change caused the issue with configurable products no longer being able to have the ajax loader update the associated products grid, requiring a refresh of the page to generate a new associated product and on top of that to save the association to the configurable.

So if you exhibit the symptons on your configurable ajax loader spinning indefinately and you made the above change. Then it's time to undo the change.

Note: In trying to debug this error, no error was being produced.

If this saved you hours of work or saved you from a headache, feel free to buy us a beer.