Magento

eCommerce Software for Online Growth

Magento Forum

From setting up your store to managing your products, pages and promotions to generating detailed reports, the Magento User Guide empowers the user to utilize the platform for all of its vast capacity.
Available in eBook and Print formats – Download Now!!!
   
Show out of stock configurable options - as disabled select option
 
m4tthewdixon
Jr. Member
 
Total Posts:  1
Joined:  2008-09-06
 

Hi,

Firstly - Love Magento!!

I need products to show all applicable configurable options (including out of stock options) - but make out of stock options disabled.
So that the dropdown box shows all options - but the user is unable to select the associated out of stock products.

I can see the options are populated with JSON collection, but have got lost in finding where this list is populated.

Any help in this matter would be very gratefully received!

Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
8181
Jr. Member
 
Total Posts:  25
Joined:  2008-10-26
 

hey Matt, by default does it remove it from the drop down if out of stock?
Do you have to make the parent configurable product “in stock”?

I am trying to get the hang of this as well

 
Magento Community Magento Community
Magento Community
Magento Community
 
nyah
Jr. Member
 
Total Posts:  8
Joined:  2008-08-27
Leipzig, Germany
 

any new information on this issue?
I need to show the options the same way m4tthewdixon does…

 
Magento Community Magento Community
Magento Community
Magento Community
 
ptjedi
Sr. Member
 
Avatar
Total Posts:  157
Joined:  2008-03-12
Porto, Portugal
 

This is something I have been banging for months. Why does Magento doesn’t allow us to select if we want to make visible products out of stock in configurable products. It’s illogical because Simples products remain on sight when they reach qty = 0, why doesn’t the options of configurable products?

The main problem with this is that we will keep customers asking us through e-mail and phone if we do have (or use to have) a size that isn’t displayed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nyah
Jr. Member
 
Total Posts:  8
Joined:  2008-08-27
Leipzig, Germany
 

Finally I found an approach to solve this issue… you have to rewrite the getAllowedProducs() function in Mage_Catalog_Block_Product_View_Type_Configurable. It’s responsible for filtering unavailable products out of the assigned simple product options.
Rewrite

public function getAllowProducts()
    
{
        
if (!$this->hasAllowProducts()) {
            $products 
= array();
            
$allProducts $this->getProduct()->getTypeInstance()->getUsedProducts();
            foreach (
$allProducts as $product{
                
if ($product->isSaleable()) {
                    $products[] 
$product;
                
}
            }
            $this
->setAllowProducts($products);
        
}
        
return $this->getData('allow_products');
    
}

with

public function getAllowProducts() {
        $allProducts 
$this->getProduct()->getTypeInstance()->getUsedProducts();
        
$this->setAllowProducts($allProducts);
        return 
$this->getData('allow_products');
    
}

and all product options are displayed in options dropdown. From this point you can add your own functions to mark the unavailable options…

hope this helps a bit wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
ptjedi
Sr. Member
 
Avatar
Total Posts:  157
Joined:  2008-03-12
Porto, Portugal
 

Well, that’s a start!
Now we just have to find the constructor of the selection box and tell it that the nonSaleable products of the whole “apparentlySaleable” product collection remain gray.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nyah
Jr. Member
 
Total Posts:  8
Joined:  2008-08-27
Leipzig, Germany
 

I had to do something similar… the unavailable products should be highlighted in grey.
I wrote a function wich filtered the unavailable products and collected the ids of the configurable attribute (wich is the option value), passed them to javascript via json and changed the style (background color) of the appropriate options. Or you could disable the unavailable options so that they are visible but not selectable…

 
Magento Community Magento Community
Magento Community
Magento Community
 
rhino
Jr. Member
 
Total Posts:  20
Joined:  2007-08-31
 

@nyah: Would you be kind enough to post your solution? I would like sold out options to be marked in gray. It would really reduce the number of phone calls we receive.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ptjedi
Sr. Member
 
Avatar
Total Posts:  157
Joined:  2008-03-12
Porto, Portugal
 

Version 1.3 out and this issue/flaw is still not corrected. :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Sr. Member
 
Avatar
Total Posts:  184
Joined:  2008-10-21
 

http://www.magentocommerce.com/boards/viewthread/33550/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scott Munn
Jr. Member
 
Total Posts:  19
Joined:  2009-09-04
 

Has anyone been able to get this working so that it will show the items but as a disabled drop-down option?  I can get Magento to show them all, but not sure where to add the disabled code to the drop down menu.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Member
 
Avatar
Total Posts:  67
Joined:  2009-11-10
 

Hello Guys,

My Custom Stock Status extension does this a bit differently - it displays the out of stock option and allows to select it, however hides the add to cart button. You can also display custom stock status for each option (e.g. will be in 3 days, expected soon, etc.), more info available here:
http://www.magentocommerce.com/extension/2386/custom-stock-status

Do you think it could work for you?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Member
 
Avatar
Total Posts:  67
Joined:  2009-11-10
 
nyah - 28 November 2008 01:17 AM

any new information on this issue?
I need to show the options the same way m4tthewdixon does…

Could my extension work for you or is it mandatory for the out of stock options to be unselectable? Trying to get improvement ideas:).

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2010 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
177711 users|1190 users currently online|277287 forum posts