Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Export Related products
 
p4pravin
Member
 
Avatar
Total Posts:  48
Joined:  2008-08-25
 

$productid Mage::getModel('catalog/product')->getIdBySku($row['sku']);
 
$product Mage::getModel('catalog/product')->load($productid);

$rProducts = array();
foreach(
$product->getRelatedProductIds() as $related_product)
{
     $related 
Mage::getModel('catalog/product')->load($related_product);
      
$rProducts[] $related->getSku();
}
$row[
'related'implode(";",$rProducts);

i try to export related product , but as the single product has multiple related products and as i need to show the sku , i need to loop th’ each product id , load the product and get the SKU for that product, so it consumes so much memory and some time result into “500 internal server error” or “allowed memory exhausted” , i have already increase the execution time to 36000 and memory limit to 512MB

Can any one help me about how can i optimize the code to get related product skus for each product.

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top