State is activated by default when adding new products
Open file/app/code/core/mage/catalog/model/product/status.php, comment out "Please select"
[PHP]View Plaincopy
- /**
- * Retrieve option array with empty value
- *
- * @return Array
- */
- static public Function getalloptions ()
- {
- $res = Array (
- /*
- Array
- ' Value ' = ',
- ' Label ' = mage::helper (' catalog ')->__ ('------')
- )*/
- );
- foreach (Self::getoptionarray () as $index = = $value) {
- $res [] = Array (
- ' Value ' = $index,
- ' Label ' = $value
- );
- }
- return $res;
- }
Inventory status is in stock by default
Open file/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml, and then
[PHP]View Plaincopy
- <select id= "inventory_stock_availability" name= "<?php Echo $this->getfieldsuffix ()? >[stock_data][is_in _stock] "class=" select "<?php echo $_readonly;? >>
- <?php foreach ($this->getstockoption () as $option):?>
- <?php $_selected = ($option [' value '] = = $this->getfieldvalue (' Is_in_stock '))? ' selected= ' selected "': '?>
- <option value= "<?php echo $option [' value ']?> <?php echo $_selected? >><?php echo $option [' label '] ?></option>
- <?php Endforeach;?>
- </select>
In the ' selected= ' selected ': '
Replace with ': ' selected= ' selected '
Magento--The state is activated by default when adding new products, inventory status is in stock by default