Magento: Get parent id of simple product associated to configurable product
A simple product is associated with a configurable product. You have the id of the simple product. Now, you need the id of the configurable product with which the simple product is associated.
Get parent product id, i.e. get id of configurable product from a simple product.
Note: This method is deprecated after 220.127.116.11
$_product = Mage::getModel('catalog/product')->load(YOUR_SIMPLE_PRODUCT_ID);
$parentIdArray = $_product->loadParentProductIds()->getData('parent_product_ids');
This is the working method.
$_productId = YOUR_PRODUCT_ID;
$parentIdArray = Mage::getModel('catalog/product_type_configurable')
Hope it helps. Thanks.