मुझे कस्टम एट्रीब्यूट की श्रेणी में जोड़ने की आवश्यकता है, 2 मानों के साथ चयन करें:
- 0 - "नहीं"
- 1 - "हाँ"
मैंने एक मॉड्यूल बनाया और स्थापना फ़ाइल में इस कोड का उपयोग किया:
$this->startSetup();
$this->addAttribute('catalog_category', 'top_brand', array(
'group' => 'General',
'type' => 'int',//can be int, varchar, decimal, text, datetime
'backend' => '',
'frontend_input' => '',
'frontend' => '',
'label' => 'Top Hersteller',
'input' => 'select', //text, textarea, select, file, image, multilselect
'option' => array(
'value' => array(
'optionone'=> array(
0 =>'No'),
'optiontwo'=> array(
0 =>'Yes')
),
),
'default' => array(0),
'class' => '',
// 'source' => '',//this is necessary for select and multilelect, for the rest leave it blank
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,//scope can be SCOPE_STORE or SCOPE_GLOBAL or SCOPE_WEBSITE
'visible' => true,
'frontend_class' => '',
'required' => false,//or true
'user_defined' => true,
'default' => '',
'position' => 100,//any number will do
));
$this->endSetup();
व्यवस्थापन पैनल में विशेषता दिखाई देती है लेकिन "नहीं" के लिए चयन में जोड़ा गया मूल्य 3 है और "हां" के लिए 4 है। मान 0 और 1 कैसे बनाएं?