cancel
Showing results for 
Search instead for 
Did you mean: 

Why Product attribute assigned to all attribute set?

SOLVED

Why Product attribute assigned to all attribute set?

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.

 

Prema M
2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Why Product attribute assigned to all attribute set?

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.

Prema M

View solution in original post

Re: Why Product attribute assigned to all attribute set?

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:Smiley FrustratedCOPE_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!

View solution in original post

2 REPLIES 2

Re: Why Product attribute assigned to all attribute set?

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.

Prema M

Re: Why Product attribute assigned to all attribute set?

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:Smiley FrustratedCOPE_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!