0

I created a new product type, but doesn't need to have all product attributes - like price, stock, weight, etc. How can i remove the attributes only for one product type?

Here is a solution for Magento 1(no biggie to adjust it to Magento 2) by updating apply_to for the attribute. But that could make a lot of problems later on(for example, if you need to install a third party module which has a new product type and you forgot to add it into apply_to list).

My question: It there other way to remove product attributes for a specific product type?

1 Answer 1

0

It is not possible to remove some of the attributes that you want to remove, for example: weight, price, sku and etc.If you go to admin panel -> Stores -> Attributes -> Attribute Set and if you open default attribute set you will see which one can't be removed /they have little red sign/. You can create attribute set from default attribute set and you can remove all attributes that are unnecessary.

How to do it programatically check on the link below.

https://www.smartiehastheanswer.co.uk/magento2/creating-eav-product-attributes-in-magento2-programmatically.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.