public function isSalable($product = null) { $salable = parent::isSalable($product); if ($salable !== false) { $salable = false; if (!is_null($product)) { $this->setStoreFilter($product->getStoreId(), $product); } if (!Mage::app()->getStore()->isAdmin() && $product) { $collection = $this->getUsedProductCollection($product)->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)->setPageSize(1); if ($collection->getFirstItem()->getId()) { $salable = true; } } else { foreach ($this->getUsedProducts(null, $product) as $child) { if ($child->isSalable()) { $salable = true; break; } } } } return $salable; }