cancel
Showing results for 
Search instead for 
Did you mean: 

Difference Between setCustomAttribute And addData In EVA Attributes

Difference Between setCustomAttribute And addData In EVA Attributes

Hi Guys , I hope all of you are doing well, 

I have confusion on following two methods .

 1: setCustomAttribute

 2: addData

 

Which one should be used while saving product data .

Can anyone guide me with specific reason .

3 REPLIES 3

Re: Difference Between setCustomAttribute And addData In EVA Attributes

Custom attributes are those added on behalf of a merchant. For example, a merchant might need to add attributes to describe products, such as shape or volume. A merchant can add these attributes in the Admin panel and addData to eav attribute is deprecated now.

To understand more about Custom attribute see below guide.

https://devdocs.magento.com/guides/v2.4/extension-dev-guide/attributes.html

Re: Difference Between setCustomAttribute And addData In EVA Attributes


@shraddhash9dd4 wrote:

Custom attributes are those added on behalf of a merchant. For example, a merchant might need to add attributes to describe products, such as shape or volume. A merchant can add these attributes in the Admin panel and addData to eav attribute is deprecated now.

To understand more about Custom attribute see below guide.

https://devdocs.magento.com/guides/v2.4/extension-dev-guide/attributes.html


Hello,

 

Thanks for the information, I will try to figure it out for more. Keep sharing such informative post.

Re: Difference Between setCustomAttribute And addData In EVA Attributes

Last week, we took a look into Magento tutorial 18 – how to override core files in Magento and learned overriding principle in Magento as well as overriding model class, helper class and resource model in Magento.