$product_type = $product->getData('type_id');
if ($product_type=='simple') {
$parentIdArray = $product->loadParentProductIds()->getData('parent_product_ids');
print_r($parentIdArray);
}
Check the comments from Gabriel Somoza for getting the Parent Product Ids for Magento versions greater than or equal to 1.4.2
Related Articles
- Magento eCommerce Imagine Conference Report (solutionset.com)
- E-Commerce made easy: Magento (xemion.com)
- Displaying New Products in Magento with Pagination (freelancedesignerindelhi.wordpress.com)
- How to show product on home page : magento (freelancedesignerindelhi.wordpress.com)
- Magento SEO: 5 Tips To Optimize Magento E-Commerce Sites For SEO (searchenginepeople.com)
- how to change paypal message : magento (freelancedesignerindelhi.wordpress.com)
As of Magento CE 1.4.2.0 the loadParentProductIds() function is deprecated. I wrote an article on the new way of doing it here: http://gabrielsomoza.com/magento/getting-a-products-parent-id-in-magento/
LikeLike
I have to say i am very impressed with the way you efficiently site and your posts are so informative. You have really have managed to catch the attention of many it seems, keep it up!
LikeLike
I dont think Ive scan anything like this before. So good to find somebody with some original thoughts on this subject. thank for starting this up. This site is something that is needed on the web, someone with a little originality. Good job for bringing something new to the internet!
LikeLike
I really like the fresh perpective you did on the issue. Really was not expecting that when I started off studying. Your concepts were easy to understand that I wondered why I never looked at it before. Glad to know that there’s an individual out there that definitely understands what he’s discussing. Great job
LikeLike