$proId=10; //Use your Configurable product Id $_product = new Mage_Catalog_Model_Product(); $childIds = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($proId); foreach($childIds[0] as $key=>$val) { $associatedProduct = Mage::getModel('catalog/product') ->load($val); echo $associatedProduct ->getName(); //You can fetch all attribute in each associated product, for ex: size $sizeids[] = $associatedProduct ->getSize(); $sizename[] = $associatedProduct ->getAttributeText('size'); }
How to get all associated products to a configurable product in Magento
Posted by
rajthegr8
at
11:28 AM
Saturday, August 18, 2012
Configurable product is the product which is created by some Associated product, If you have an configurable product and you want to get list of all associated product and it's attribute then, follow the below code:You must have your configurable product Id, My configurable product Id is 10
Subscribe to:
Post Comments (Atom)
Blog Archive
Popular Posts
-
You can select,insert,update and delete data in the Magento wby using their models concept. For example,a table named ‘testdata‘ with the fo...
-
This article will explain how to create an extension to send all the emails through gmail or other servers.I have created an module to set u...
-
This is an article to show you ,how you can set MySql Master-slave replication in magento for scalability ,handle failover and performance. ...
-
Breadcrumb is necessary for making website pages user navigation friendly. It can be printed out in any of the php or phtml pages by below c...
-
This blog will show you how to get all items in a shopping cart and totals in a magento store : $items = Mage::getSingleton('checkout/...
how do i use that?