- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While creating set of product attributes via program, it gets assigned to existing Product Sets as well as to newly created Product Sets. I don't want to assign those created attribute to any Attribute Set.
Can anyone help me to solve this issue.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After creation, remove the attribute group from the Default attribute set, which you do not want to add in new attribute set. Because new sets gets created based on Default Attribute Set.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Prema,
Pass 'user_defined' => true to stop assigning attribute to any attribute set.
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
$finalAttributeID,
[
'type' => $type,
'backend' => '',
'frontend' => '',
'label' => $attName,
'input' => 'text',
'class' => '',
'source' => '',
'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface:COPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => '',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_in_product_listing' => true,
'unique' => false
]
);
Hope it helps!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Prema,
Pass 'user_defined' => true to stop assigning attribute to any attribute set.
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
$finalAttributeID,
[
'type' => $type,
'backend' => '',
'frontend' => '',
'label' => $attName,
'input' => 'text',
'class' => '',
'source' => '',
'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface:COPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => '',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_in_product_listing' => true,
'unique' => false
]
);
Hope it helps!