//for example:
// I will add a attribute group named 'Vendor' to 'Default' attribute set
function addAttributeGroup($group_name, $attrSetName,$sort_order) { $modelGroup = Mage::getModel('eav/entity_attribute_group'); $attributeSetId = Mage::getModel('eav/entity_attribute_set') ->load($attrSetName, 'attribute_set_name') ->getAttributeSetId(); $modelGroup->setAttributeGroupName($group_name) //change group name //link to the current set ->setAttributeSetId($attributeSetId) //set the order in the set ->setSortOrder($sort_order); //save the new group $modelGroup->save(); } addAttributeGroup('Vendor', 'Default',100);
//Then Create a Select drop down attribute and add it to the group
function createSelectAttribute($code, $label, $group_name ) { $_attribute_data = array( 'type' => 'int', 'input' => 'select', 'label' => $label, 'sort_order' => 1000, 'required' => false, 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'backend' => 'eav/entity_attribute_backend_array', 'option' => array ( 'values' => array( ) ), 'group' => $group_name, 'visible' => true, 'visible_on_front'=>true, 'unique' => false, 'is_configurable' => false, 'used_for_promo_rules' => true, ); $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup'); $attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $code); if ($attrIdTest === false) { $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $code, $_attribute_data); } } //add vendor name createSelectAttribute('vendor_name','Vendor Name','Vendor'); //add vendor no createSelectAttribute('vendor_no','Vendor Number','Vendor');
//at Last i write a text format attribute function
function createTextAttribute($code, $label, $group_name ) { $_attribute_data = array( 'type' => 'varchar', 'input' => 'text', 'label' => $label, 'required' => false, 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'backend' => '', 'group' => $group_name, 'visible' => true, 'visible_on_front'=>true, 'unique' => false, 'is_configurable' => false, 'used_for_promo_rules' => true ); $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup'); $attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $code); if ($attrIdTest === false) { $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $code, $_attribute_data); } } //add vendor item no createTextAttribute('vendor_item_no','Vendor Item Number','Vendor');
相关推荐
Module 8: Introduction to Data Analysis [removed]DAX)This module describes how to use DAX to create measures and calculated columns in a tabular data model.Lessons DAX Fundamentals Using DAX to ...
Animation (ASP.NET Enterprise Edition only) - Version 4.0 now lets you enable charts with Flash and SVG Animation, to add a new level of presentation to your charts. With a variety of pre built ...
• Create entities and add attributes • Determine the appropriate relationship between entities • Resolve many-to-many relationships with a linking table chapter 5: Normalization and design review ...
We recommend to use TMS components to create modern user interfaces, toolbars and ribbons. 19.2.2013 - WPTools 6.29.1 - fix in rtf writing code to solve problem with merged cells - fix possible range...
4) Add the Drag and Drop Component Suite components directory to your library path. 5) Load the demo project group: demo\dragdrop_delphi.bpg for Delphi 5 and 6 demo\dragdrop_bcb4.bpg for C++ ...
This specification was developed in response to a perceived need for a standardized programming inter-face to digitizing tablets, three dimensional position sensors, and other pointing devices by a ...
In particular, do not add new parameters to the end of the function just because they are new; place new input-only parameters before the output parameters. This is not a hard-and-fast rule. ...
FastReport® VCL is an add-on component that allows your application to generate reports quickly and efficiently. FastReport® provides all the tools necessary for developing reports, including a ...
+ added an ability to create multiimage TIFF files + added export headers/footers in ODF export + added ability to print/export transparent pictures (properties TfrxPictureView.Transparent and ...
3 Organization of This Text and Pedagogical Concerns 4 Obtaining Program Source Listings and Other Materials in This Text <br>Section One: Machine Organization <br>Art of Assembly ...
先选责需要另存图层的要素(直接选择或者属性表),然后在图层上右键Selection/create Layer From Selected Features。 (以前都是直接export竟然没有发现) 27.利用Hyperlinks丰富数据库,为其添加超链接。 单击...
ret = sysfs_create_group(&dev->pdev->dev.kobj, &vfe_attribute_group); #ifdef CONFIG_ES dev->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB + 1; dev->early_suspend.suspend = vfe_early_suspend...
ret = sysfs_create_group(&dev->pdev->dev.kobj, &vfe_attribute_group); #ifdef CONFIG_ES dev->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB + 1; dev->early_suspend.suspend = vfe_early_suspend...
Working with Projects, Folders, Resources, and Configurations ................................................... 2-1 Resource Naming Restrictions ........................................................
&是位运算符,表示按位与运算,&&是逻辑运算符,表示逻辑与(and)。 11、HashMap和Hashtable的区别。 HashMap是Hashtable的轻量级实现(非线程安全的实现),他们都完成了Map接口,主要区别在于HashMap允许空...