Magento 在组的顶部添加属性

Magento add attribute on top of the group

我有 magento 1.8。我想在产品中添加产品属性。我可以做所有这些,但是当我想添加特定属性以位于组中其他属性(后台排序顺序)之上时。我该怎么做?

$this->addAttribute('catalog_product', 'my_subtitle', array(
'attribute_model'                 => NULL,
'backend'                         => NULL,
'type'                            => 'text',
'table'                           => NULL,
'frontend'                        => NULL,
'input'                           => 'text',
'label'                           => 'Subtitle',
'frontend_class'                  => NULL,
'source'                          => NULL,
'required'                        => '0',
'user_defined'                    => true,
'default'                         => NULL,
'unique'                          => '0',
'note'                            => NULL,
'input_renderer'                  => NULL,
'visible'                         => '1',
'searchable'                      => '1',
'filterable'                      => '1',
'comparable'                      => '1',
'visible_on_front'                => '1',
'is_html_allowed_on_front'        => '1',
'is_used_for_price_rules'         => '0',
'filterable_in_search'            => '0',
'used_in_product_listing'         => '1',
'used_for_sort_by'                => '0',
'is_configurable'                 => '0',
'visible_in_advanced_search'      => '0',
'position'                        => '0',
'wysiwyg_enabled'                 => '0',
'used_for_promo_rules'            => '0',
'apply_to'                        => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE,
'global'                          => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,));

尝试添加:

'sort_order'                 => -1,  // Or 0

$this->addAttribute('catalog_product', 'my_subtitle', array(
    'sort_order'                 => -1,  // Or 0
    ...
    )
);

这样,根据 sort_order

,您的新属性应该显示在其余属性之前