Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $eavSetup->addAttribute(
- ProductAttributeInterface::ENTITY_TYPE_CODE,
- 'example',
- [
- 'type' => 'example',
- 'input' => 'textarea',
- 'frontend_class' => 'no-whitespace validate-no-html-tags',
- 'label' => 'example',
- 'group' => '',
- 'sort_order' => '',
- 'backend' => '',
- 'frontend' => '',
- 'source' => '',
- 'default' => '',
- 'wysiwyg_enabled' => false,
- 'is_html_allowed_on_front' => false,
- 'used_for_sort_by' => false,
- 'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
- 'visible' => true,
- 'required' => false,
- 'user_defined' => true,
- 'searchable' => true,
- 'visible_in_advanced_search' => true,
- 'search_weight' => 5,
- 'filterable' => false,
- 'filterable_in_search' => false,
- 'comparable' => false,
- 'visible_on_front' => false,
- 'used_in_product_listing' => true,
- 'unique' => false,
- 'apply_to' => '',
- 'used_for_promo_rules' => true,
- 'is_used_in_grid' => false,
- 'is_visible_in_grid' => false,
- 'is_filterable_in_grid' => false,
- 'is_required_in_admin_store' => '',
- 'system' => 0
- ]
- );
- $this->attributeSetFactory->create()
- ->setEntityTypeId($this->_entityTypeId)
- ->setAttributeSetName('Test')
- ->setSortOrder(50)
- ->initFromSkeleton($this->_defaultAttributeSetId)
- ->save();
- $attributeSetId = $eavSetup->getAttributeSetId($this->_entityTypeId, 'Test');
- $groupId = $eavSetup->getAttributeGroupId($this->_entityTypeId, $attributeSetId, 'product details');
- $attributeId = $eavSetup->getAttributeId($this->_entityTypeId, 'example');
- $eavSetup->addAttributeToSet($this->_entityTypeId, $attributeSetId, $groupId, $attributeId, 50);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement