It seems that both Custom Attributes and Extension Attributes can be used to add fields to entities. What should a developer consider when choosing between the two?
It seems that Custom Attribute fields may just “appear” on the backend, but will not just “appear” on the frontend in Magento Open Source. But they can be added to the frontend by editing the PHTML files I believe. Can Extension Attributes be presented on both the frontend and the backend? Will they just “appear” in either location? If not, how are they added to the PHTML fields? What must be done to get them to appear in the backend? How about Customers’ personal dashboards?
For instance, consider a text field on a Customer Address. This field should appear in the following Forms:
- Checkout Guest
- Checkout Logged In (Store New Address)
- Customer Dashboard -> Address Book -> Add New Address (customer_address_new)
- Customer Dashboard -> Address Book -> Edit Address (customer_address_edit)
- Admin Dashboard: Customers -> All Customers -> Edit -> Address tab (customer_index_edit)
- Admin Dashboard: Sales -> Orders -> Edit -> Billing Address
Should that be a Custom Attribute or Extension Attribute?
How about a field that would be directly on the Customer itself? Such a field should appear in the following Forms:
- Customer Account Create Form
- Customer Dashboard: Edit Account Information (customer_account_edit)
- Admin Dashboard: Customers -> All Customers -> Edit -> Account Information tab (customer_index_edit)
Should that be a Custom Attribute or Extension Attribute?
submitted by /u/dotancohen
[link] [comments]