I need to get the parent configurable product from a simple product, even if the parent product is marked as disabled. I also need to get the status of the configurable product (enabled or disabled).
Right now I'm getting the parent product like this:
$parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
if (isset($parentIds[0])) {
$product = Mage::getModel('catalog/product')->load($parentIds[0]);
}
This works perfectly unless the configurable product has been disabled, where the $parentIds array is empty. I need to get the configurable product even if it's disabled, and also determine if the configurable product is enabled/disabled.
Any help would be appreciated!