Magento Forum

   
SOLVED - How to remove “Choose option…” from configurable product select dropdowns
 
ben_marks
Moderator
 
Avatar
Total Posts:  449
Joined:  2008-10-09
Charleston, SC
 

ref http://blog.pothoven.net/2006/10/addremove-options-tofrom-select-list.html

In catalog/product/view/type/options/configurable.phtml, change:

<script type="text/javascript">
        var 
spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
    
</script>

to:

<script type="text/javascript">
        var 
spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
    
</script>
    
<script type="text/javascript">
        
//remove "Choose option..." option
        
$$('select.super-attribute-select').each(function(elem){
            removeSelectOptByVal
($(elem).identify(), '');
        
});

        function 
removeSelectOptByVal(selectIdvalue{
            
var select document.getElementById(selectId);
            var 
kids select.childNodes
            var 
numkids kids.length
            for (var 
0numkidsi++) {
                
if (kids[i].value == value{
                    select
.removeChild(kids[i]);
                    break;
                
}
            }
        }                
    </script>

 
Magento Community Magento Community
Magento Community
Magento Community
 
ModifyMage
Sr. Member
 
Avatar
Total Posts:  84
Joined:  2008-10-15
 

Excellent. Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Stefan88
Jr. Member
 
Total Posts:  12
Joined:  2010-10-18
 

it aint work in 1.5.1, the choose option stil is standing there

 
Magento Community Magento Community
Magento Community
Magento Community
 
gab80
Jr. Member
 
Total Posts:  7
Joined:  2011-05-05
 

Thank you blueben, but unfortunately it doesn’t work with 1.5.1.
Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top