How to remove initial blank value for dropdown attribute in Magento?

I am using Magento version 1.5.1.0. I added an attribute with the following options selected on the Properties tab:

Catalog input type for store owner: dropdown
Unique value: no
Values required: no

Then I went to the “Shortcut / Options Management” tab and added 3 different options, choosing the first option by default. I added it to the attribute set, and when I go to the product input, I see a drop-down menu, but with the parameter value added before it:

<select>
<option selected="selected"></option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>

When I save the product, an empty option is still selected. How to remove this empty option and make option 1 the default for all my existing products without resorting to using JS or editing any files at all?

+5
source share
2

, .

getAllOptions, false.

- > getAllOptions ()

Magento

+2
<select name="history[status]" class="select" id="history_status">
     <option value="pending" selected="selected">Pending</option>
     <option value="canceled">Canceled</option>
     <option value="processing">Processing</option>
</select>

SELECT, . Magento.

<option selected="selected></option>

. , .

0

All Articles