Magento 2 Extensions:Order And Customer Attributes
Collecting additional order and customer information has never been easier. Easily add as many fields as required to the Magento checkout and store them against the order, customer or customer address. Display collected information in the Magento backend and the orders grid. Supports various field types (text field, area, checkbox, select, date, ...) and is fully integrated for interaction with the Magento 2 API.
Interested in this Magento Extension?
Head over to our store to purchase this extension: Order & Customer Attributes (Magento 2)
Got questions? Feel free to contact us! Contact Form
Setting up the extension
- Please refer to our general Extension Installation and Setup Guide for installation instructions.
The extensions configuration section is located at System > XTENTO > Custom Attributes. Make sure to enable the extension there.
Using the extension
Go to Stores > Manage Order/Customer Attributes to manage your custom attributes. This is the main configuration of the extension.
Use the "Add" button to add a new attribute to Magento. You can select from three options:
- Order Attribute: Adds an attribute to the sales/order entity in Magento, stored in the sales_order table in the database. Useful to capture any additional order information such as comments & more.
- Customer Attribute: Adds an attribute to the customer entity in Magento, stored in the customer EAV tables. Useful to add fields stored with the customer such as a custom "customer ID", etc.
- Customer Address Attribute: Adds an attribute to the customer address entity in Magento, stored in the customer address EAV tables. Useful if you need to add a field to the billing/shipping address specifically.
After selecting an attribute type, you will be presented with the attribute configuration:
|Option / Setting||Description|
|Default Label||Label shown in checkout/admin. Translate in "Labels" tab.|
|Attribute Type||Order/Customer/Customer Attribute. Cannot be changed for an attribute after attribute creation.|
|Field Type||Frontend/backend input type for the attribute. Possible values: Text Field, Text Area, Date, Date & Time, Yes/No, Multiple Select, Dropdown, Radio Buttons, Checkboxes. Cannot be changed for an attribute after attribute creation.|
|Enabled||Yes/No. If disabled, won't show up in the backend and frontend.|
|Attribute Code||This is the internal identifier for the attribute. It is the column name in the database, and used when updating the attribute via the API for example. Make sure you don't use spaces or more than 30 symbols. Use lowercase names only, and replace spaces with the _ character. Example: my_custom_attribute|
|Default Value||Pre-populate the input field with a default value|
|Option / Setting||Description|
|Visible in Backend||If enabled, the attribute will be shown when viewing an order/customer|
|Show in admin grids||If enabled, you can show this field in the Sales > Orders grid|
|Show on PDF||If enabled, the attribute will be shown on PDF printouts|
|Checkout Field Position||If required you can specify a sort order to manage sorting of custom attributes in the Magento checkout|
|Visible on Frontend||Specify where in the frontend this attribute should be visible. You can also hide it from the frontend entirely.|
|Customer Groups||Specify if only certain customer groups are allowed to see the attribute in the frontend|
|Checkout Tooltip||Add a tooltip/help text that is shown when hovered over the attribute in the checkout|
|Checkout Location||Specify where the attribute is shown in the Magento checkout. Possible values: Billing Address, Shipping Address, Both Addresses, Above shipping address, Above shipping methods, Above place order, Above payment methods, Below payment methods|
|Required||If set to "Yes", the customer will need to enter a value whenever he encounters this attribute, be it in the checkout or when editing his account.|
Specify store views in which this attribute should be displayed.
Labels / Translation
Easily translate the attribute label for each of your store views.
After configuring your attribute, click the "Save" button to create the attribute. You can now use it everywhere in Magento, via the API and in the Magento checkout.
How do I access the attributes via the Magento 2 API?
Custom attributes created using this extension are fully integrated into the Magento 2 API. You can see them on order, customer or customer address level, depending on the attribute type you have created. You can also access them directly in the Magento database, they are proper attributes added to the "sales_order" table (and "customer" tables for customer attributes).