Actually i want to optimize my store. It takes 5 to 6s. I m using ready theme from theme forest. According to theme m doing some of customization according my requirements which i needed. ON this theme Already displayed new products collection and also sales collection. Now i want to load 2 more collection according to attributes.
So issue is on homepage product collection is load 4 times. If collection is load two times on homepage store will be load within 2s for now. For now i optimize some how my store but still will takes times to load within 4.5 to 5s because of product collection.
I am trying to get product collection by attribute. below code is working perfectly. It takes too much time to load. That's why my store is working too much slow. If i removed this code my store is load within 2 to 2.5s.
$_productCollection = Mage::getResourceModel('catalog/product_collection') ->addAttributeToFilter('popular_walldecal', array('eq' => 1)) ->setPageSize(8); $_collectionSize = $_productCollection->count(); foreach ($_productCollection as $product): $_product = Mage::getModel("catalog/product")->load($product->getID()); endforeach;
I have tried above code. If product collection loads within in ms. It will be affect on my store to page loading issue.
In above code i need to load again
$_product = Mage::getModel("catalog/product")->load($product->getID());
Otherwise i can't get all product data.
Can you help me to resolve out this issue? How to optimize this code. Thanks in advance.