do you know how to show the product "variants" (sorry if this terminology is incorrect) even if it is out of stock and possibly show "Out of stock" instead of the price?

So for example I have a T-shirt configurable product, so I have added a green single product and an orange single product as Associated products. The orange product is out of stock, I still want it to be displayed in the dropdown menu so customers know that there's an orange option but it should be out of stock so the customer can't order.

Does anybody know?

2 Answers 2


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:

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;
        return $this->getData('allow_products');


Step2: create config.xml /app/code/local/Amit/MyProduct/etc/ and code is

<?xml version="1.0"?>

Step3: Create Amit_MyProduct.xml at app/etc/modules

<?xml version="1.0"?>
  • Thank you Amit. I will create a full backup of the site overnight and try that tomorrow morning. Nov 5, 2014 at 23:08
  • Hi Amit Bera, I have just done the fix that you said and it's pulling through the product and if added to basket it shows the popup with "This product is currently out of stock.<br/>" message which is great too, however I was wondering - is it possible to add "(out of stock)" to the end of the product variant in the dropdown menu so the customer knows in advance that it isn't in stock? Nov 6, 2014 at 9:51
  • Magento is provide to backorders facility which give this type solution ,where customer can place out of stock products magentocommerce.com/knowledge-base/entry/…
    – Amit Bera
    Nov 6, 2014 at 9:57
  • But disabled products are also showing in dropdown after implementing this? why??? Jun 24, 2015 at 2:00

You can do this without any rewrites.
Just use the event catalog_controller_product_init.
So add this to the config.xml from one of your modules inside the <frontend><events> tag


Then create the file Observer.php inside the Model folder with this content

class [Namespace]_[Module]_Model_Observer
    public function showOutOfStock($observer)
        $product = $observer->getEvent()->getProduct();
        if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
  • can we do the same in m2 also? Dec 20, 2018 at 14:16
  • most likely. I just don't know how. Maybe look for the method getSkipSaleableCheck, not sure in what class it is. And make an after plugin for it, that returns true.
    – Marius
    Dec 20, 2018 at 14:19
  • I am looking for it, but nowhere finding the proper solution Dec 20, 2018 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.