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, 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

Magento Forum

How to get all the attributes of my products
Jr. Member
Total Posts:  27
Joined:  2009-07-03


I’m starting in Magento.
I have to generate a xml file with all the attributes of my products.
1 product is made of 1 or more sub-products, and 1 sub-product is made of 1 or more activities.
So i have to get all my products, with all their sub-products, with all their activities.

1- Do I have to make a script outside of magento or inside ?
If it’s inside magento, how will i call this script ?
I started with an outside script like that :

$collectionProduct Mage::getModel('catalog/product')->getCollection();
$collectionProduct ->addAttributeToFilter('sku''123');
$collectionProduct as $a){
So I get all the attributes from my product. Is it ok or not ?

2- How do I do the link between my product and my sub-product ?
In sql, it will be :

FROM mage_catalog_product_entity e
INNER JOIN mage_catalog_product_bundle_selection s ON s
.parent_product_id e.entity_id
.entity_id MY_PRODUCT_ID
I tried to translate it to magento like that :
$select $collectionSubProduct->getSelect()
from(array('mcpbs' => 'mage_catalog_product_bundle_selection'))
where('e.entity_id = 12 AND mcpbs.parent_product_id = e.entity_id');
If it is the good writing, how do i execute the query to get the result ?


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