【发布时间】:2014-03-20 11:16:31
【问题描述】:
对于允许自定义价格,只有是/否,但我也想添加“使用配置”选项,如应用地图选择我该怎么做?
这是属性:
$setup->addAttribute('catalog_product', 'allow_customprice', array(
'group' => 'Prices',
'input' => 'select',
'label' => 'Allow Custom Price',
'source' => 'eav/entity_attribute_source_boolean',
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'searchable' => 1,
'filterable' => 0,
'default' => 1,
'comparable' => 1,
'visible_on_front' => 1,
'visible_in_advanced_search' => 0,
'is_html_allowed_on_front' => 0,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
这就是system.xml:
<fields>
<enablecp translate="label">
<label>Enable Custom Price</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<comment>Option for all products.</comment>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</enablecp>
<!-- END FIELD -->
<minprice translate="label">
<label>Min Price</label>
<frontend_type>text</frontend_type>
<validate>validate-number</validate>
<comment>Min price for all products.</comment>
<sort_order>60</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minprice>
<!-- END FIELD -->
</fields>
谢谢你的提前
【问题讨论】:
标签: magento