0

This question is an exact duplicate of:

I presume the website pages are slow down because of this filter to get only configurable products..

I used ->addAttributeToFilter('type_id', array('eq' => 'configurable')); this code works perfectly.. problem is page load is very very slow.

But when I try alternative methods(as follows) to reduce the page load time.. Its not working as expected and page load time is reducing but I see the duplicated product price and images on the page..

1) $_productCollection = clone $this->getLoadedProductCollection();
// Unset the current products and filter before loading the next.
$_productCollection->clear()
                   ->addAttributeToFilter('type_id', 'configurable')
                   ->load();


2) Mage::getResourceModel('catalog/product_type_configurable_product_collection')

3) ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility

4) ->setVisibility(4);

all above methods are not working for me to show the original title, price, images.. But the page load time is reduced..

Please suggest me is there any other method to get only configurable products with correct image, price, product name.,..

Thanks,

marked as duplicate by Siarhey Uchukhlebau, liyakat, Rakesh Jesadiya, Amit Bera, Qaisar Satti Jun 7 '17 at 6:59

This question was marked as an exact duplicate of an existing question.

0

If fetch collection data cost too much, please try to consider use collection cache.

$_productCollection->addAttributeToFilter('type_id', array('eq' => 
  'configurable'));
   if(Mage::app()->useCache('collections')) {
            $_productCollection->initCache(Mage::app()->getCache(),'you_cache_id',array('COLLECTION_DATA'));
        }

System will fetch data from cache instead of database next time.

At the end, it is strong recommended to use xdebug+kcachegrind to find the exact reason for the performance issue.

0

The most important step to reduce the page load time is to analyze and validate what is taking so long. A good tool for this is the AOE_Profiler https://github.com/AOEpeople/Aoe_Profiler

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