You can view out of stock variable in product by remove this code
if ($product->isSaleable() || $skipSaleableCheck) {
from function getAllowProducts()
at class Mage_Catalog_Block_Product_View_Type_Configurable
.
So you need to rewrite
class Mage_Catalog_Block_Product_View_Type_Configurable
Step1: You will need to create /app/code/local/Amit/MyProduct/Block/Catalog/Product/View/Type/
and file Configurable.php
and code:
<?php
class Amit_MyProduct_Block_Catalog_Product_View_Type_Configurable extends Mage_Catalog_Block_Product_View_Type_Configurable{
public function getAllowProducts()
{
if (!$this->hasAllowProducts()) {
$products = array();
$skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck();
$allProducts = $this->getProduct()->getTypeInstance(true)
->getUsedProducts(null, $this->getProduct());
foreach ($allProducts as $product) {
$products[] = $product;
}
$this->setAllowProducts($products);
}
return $this->getData('allow_products');
}
}
Step2: create config.xml /app/code/local/Amit/MyProduct/etc/
and code is
<?xml version="1.0"?>
<config>
<modules>
<Amit_MyProduct>
<version>1.0.0</version>
</Amit_MyProduct>
</modules>
<global>
<blocks>
<catalog>
<rewrite>
<product_view_type_configurable>Amit_MyProduct_Block_Catalog_Product_View_Type_Configurable</product_view_type_configurable>
</rewrite>
</catalog>
</blocks>
</global>
</config>
Step3: Create Amit_MyProduct.xml
at app/etc/modules
<?xml version="1.0"?>
<config>
<modules>
<Amit_MyProduct>
<codePool>local</codePool>
<active>active</active>
</Amit_MyProduct>
</modules>
</config>