cancel
Showing results for 
Search instead for 
Did you mean: 

How do I remove "choose an option" from products that have only one option available to select?

How do I remove "choose an option" from products that have only one option available to select?

For example; A product is only available in 1000gram, so that's the only option. Yet there are two options: "choose an option" and "1000 gram" IF there is only one option to select, then I want that option to be automatically selected.

 

Any suggestions?

 

(I use configurable products, even if there is only one product configuration available because most of our products do have multiple options, bu this way the customer knows where to look for the color or size.)

3 REPLIES 3

Re: How do I remove "choose an option" from products that have only one option available t

I am looking for the same solution. Does anyone know how to do it? 

Magento Certified Solution Specialist | Lead Magento developer
If this response was helpful to you, consider giving kudos to this post

Re: How do I remove "choose an option" from products that have only one option available t

1. Admin > System > configuration > select appropriate store > select developer in the last section in left navigation panel > enable template hints
2. you can now identify the specific phtml file these dropdowns are appearing from.
3. Edit that phtml and notice that the dropdown first shows this default option and then adds the options passed through an array using a foreach loop.
4. Place a condition around the first option tag like this :

<?php if(count($array_with_valid_options) > 1): ?>

    <option>choose an option</option>

<?php endif; ?>

Re: How do I remove "choose an option" from products that have only one option available t

Nope, doesn't work at all. 

Magento Certified Solution Specialist | Lead Magento developer
If this response was helpful to you, consider giving kudos to this post