添加新产品时状态默认为激活
打开文件/app/code/core/Mage/Catalog/Model/Product/Status.php,注释掉“Please Select”
- /**
- * Retrieve option array with empty value
- *
- * @return array
- */
- static public function getAllOptions()
- {
- $res = array(
- /*
- array(
- 'value' => '',
- 'label' => Mage::helper('catalog')->__('-- Please Select --')
- )*/
- );
- foreach (self::getOptionArray() as $index => $value) {
- $res[] = array(
- 'value' => $index,
- 'label' => $value
- );
- }
- return $res;
- }
库存状态默认为有库存
打开文件/app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml,将
- <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>
里的'selected="selected"' : ''
换成 '' : 'selected="selected"'