0

I have 3000 color and i want to use these color with color swatches and i uploaded all color in color attribute option. but the site is being very slow and sometimes crashed. can anyone suggest me how can i handle thousands of color.

  • At what time is the site slow? When a user navigates the front-end of the site? When you add additional color options to the attribute? When you add new products and choose the simple products? I have a site with 4200+ color options and haven't seen any issues, yet. – Michael Yaeger Aug 26 '16 at 20:54
0

I had the same problem. I suggest you override the ConfigurableSwatches/Model/Resource/Catalog/Product/Attribute/Super/Collection.php

and try to improve perform the loop (~ line 127)

$result = $this->getConnection()->fetchAll($select);
            foreach ($result as $data)

....

I changed to this

$thisClass = $this;
Mage::getSingleton('core/resource_iterator')->walk(
    $select,
    array(function($args) use (&$thisClass){
        $data = $args['row'];
        $item = $thisClass->getItemById($data['product_super_attribute_id']);
        if (!is_array($labels = $item->getOptionLabels())) {
            $labels = array();
        }
        $labels[$data['option_id']][$data['store_id']] = $data['label'];
        $item->setOptionLabels($labels);
    })
);

For me, this does not solve the problem. But to some of friends of mine worked

I had to make a lot of changes in how it (swatches module) works to improve the performance.

  • can you please share what changes you made in swatches module. - The above solutions isn't working for me either. I have magento 1.9.2 with one configurable product which has almost 1500 associated simple products – Abid Malik Nov 25 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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