My store was extremely slow on the product pages and after a little bit of debugging I found that the product swatches were causing the problem.

I've checked the server error log and the max_execution_time exceeds with the following code snippets:

/app/code/core/Mage/ConfigurableSwatches/Helper/Data.php

public static function normalizeKey($key) {
    if (function_exists('mb_strtolower')) {
        return trim(mb_strtolower($key, 'UTF-8')); // The line the error refers to
    }
    return trim(strtolower($key));
}

/app/code/core/Mage/ConfigurableSwatches/Helper/MediaFallBack.php

$optionLabels = array_map(function ($value) {
    return array_map('Mage_ConfigurableSwatches_Helper_Data::normalizeKey', $value); // Error
}, $optionLabels);

My client does prefer to have the swatches enabled on the site and the swatches are used for three attributes, but how can I solve the executing time problem or just generally speed up the swatches?

I'm using Magento 1.9.1 with the default swatches and the site runs on an nGinx server

There are many performance issues with the swatches. Try my module https://github.com/wigman/AjaxSwatches. It takes out the swatches and loads them using Ajax.

i've found the following solution Enterprise 1.14.1 Swatches causing 35 sec plus load time on category pages and it reduced the loading time of the page with 10 seconds

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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