Magento kök test attribute.php: Bir dosya ie koydu.
<?php
// Include and start Magento
require_once dirname(__FILE__).'/app/Mage.php';
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// Load attribute model and load attribute by attribute code
$model = Mage::getModel('catalog/resource_eav_attribute')->load('some_dropdown_attribute', 'attribute_code');
// Get existing options
$options = $model->getSource()->getAllOptions(false);
// Get the count to start at
$count = count($options) + 1;
// Prepare array
$data = array(
'option' => array(
'value' => array(),
'order' => array()
)
);
// You can loop here and increment $count for multiple options
$key = 'option_'.$count;
$data['option']['value'][$key] = array('Test '.$count);
$data['option']['order'][$key] = 0;
// Add array to save
$model->addData($data);
// Save
$model->save();
Öznitelik Test X adında yeni bir seçenek yaratmak olmalıdır. Tested on Magento Enterprise 1.11.2