Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. $eavSetup->addAttribute(
  2. ProductAttributeInterface::ENTITY_TYPE_CODE,
  3. 'example',
  4. [
  5. 'type' => 'example',
  6. 'input' => 'textarea',
  7. 'frontend_class' => 'no-whitespace validate-no-html-tags',
  8. 'label' => 'example',
  9.  
  10. 'group' => '',
  11. 'sort_order' => '',
  12.  
  13. 'backend' => '',
  14. 'frontend' => '',
  15. 'source' => '',
  16.  
  17. 'default' => '',
  18.  
  19. 'wysiwyg_enabled' => false,
  20. 'is_html_allowed_on_front' => false,
  21.  
  22. 'used_for_sort_by' => false,
  23.  
  24. 'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
  25. 'visible' => true,
  26. 'required' => false,
  27. 'user_defined' => true,
  28.  
  29. 'searchable' => true,
  30. 'visible_in_advanced_search' => true,
  31. 'search_weight' => 5,
  32. 'filterable' => false,
  33. 'filterable_in_search' => false,
  34. 'comparable' => false,
  35. 'visible_on_front' => false,
  36. 'used_in_product_listing' => true,
  37. 'unique' => false,
  38. 'apply_to' => '',
  39. 'used_for_promo_rules' => true,
  40.  
  41. 'is_used_in_grid' => false,
  42. 'is_visible_in_grid' => false,
  43. 'is_filterable_in_grid' => false,
  44.  
  45. 'is_required_in_admin_store' => '',
  46.  
  47. 'system' => 0
  48. ]
  49. );
  50.  
  51. $this->attributeSetFactory->create()
  52. ->setEntityTypeId($this->_entityTypeId)
  53. ->setAttributeSetName('Test')
  54. ->setSortOrder(50)
  55. ->initFromSkeleton($this->_defaultAttributeSetId)
  56. ->save();
  57.  
  58. $attributeSetId = $eavSetup->getAttributeSetId($this->_entityTypeId, 'Test');
  59. $groupId = $eavSetup->getAttributeGroupId($this->_entityTypeId, $attributeSetId, 'product details');
  60. $attributeId = $eavSetup->getAttributeId($this->_entityTypeId, 'example');
  61.  
  62. $eavSetup->addAttributeToSet($this->_entityTypeId, $attributeSetId, $groupId, $attributeId, 50);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement