I want to check if product attribute with same code already exists in setup file of my custom module?
How I could check it?
magento2productproduct-attribute
I want to check if product attribute with same code already exists in setup file of my custom module?
How I could check it?
Best Answer
Try this:
This will attempt to retrieve the attribute ID for the attribute with the code
attr_code
. If it returns a falsey value, the attribute does not exist.