Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [customer-attribute]

Creating, managing and using Customer entity attributes

Filter by
Sorted by
Tagged with
3 votes
5 answers
13k views

assign attribute to attribute set

How to assign particular attribute set to newly created attribute? My code is eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, 'test_demo221', [ //...
0 votes
1 answer
2k views

Custom customer attributes are not shown at checkout register in Magento 2

I have created custom customer attributes, it is working fine in customer registration form but not shown at checkout register page in Magento 2.
2 votes
1 answer
1k views

Magento 2 customer account doesn't allow special characters(å, ä, ø, ö, æ etc.) in the email address

Magento 2 customer account doesn't allow special characters(å, ä, ø, ö, æ etc.) in the email address field. Please do needful to allow special characters(å, ä, ø, ö, æ etc.) in the email address ...
0 votes
1 answer
1k views

Update customer's custom attribute pro-grammatically in magento 2

I am using following extension: https://github.com/diglin/Diglin_Username2 The custom attribute 'username' is created and working fine during login. But I need to update this attribute value along ...
2 votes
3 answers
1k views

Customer Information Attribute in New Order Email Template

I've scanned many posts but cannot get to bottom of this one. I have created a custom Customer Information attribute and I need it to display on the New Order transactional email. Any ideas? I have ...
0 votes
1 answer
19 views

Magento 2 : Unable to get the logeed in user data on home page

getting 0 when using use Magento\Authorization\Model\UserContextInterface::getUserId() on the home page block in cms_index_index.xml layout file.
0 votes
1 answer
27 views

How to Add Custom customer Attributes in Account Page?

After adding a custom customer attribute with a dropdown, having values 'A (11)' and 'B (12)', I attempted to display the attributes on the customer account page. However, upon adding the following ...
0 votes
2 answers
2k views

How to create customer custom attribute for radio buttons, checkbox in magento 2

I wish to create customer custom attributes with following types: 1.radio buttons 2.checkbox 3.dropdowns Please provide me a solution to create customer custom attribute.
0 votes
2 answers
3k views

How to create customer custom Drop Down attributes in magento 2

Namespace/Module/setup/installData.php $customerSetup->addAttribute(Customer::ENTITY,'credit_type', [ 'type' => 'int', 'label' => '...
2 votes
3 answers
7k views

Custom Customer attribute not saving Magento 2.3.1

I have the following code to create a custom customer attribute. <?php namespace Vendor\MyModule\Setup\Patch\Data; use Magento\Customer\Model\Customer; use Magento\Customer\Setup\...
1 vote
1 answer
2k views

Magento 2 filter not working on custom customer attribute

I have created custom customer attribute. It is displaying in customer grid in admin panel but when I try to filter on my custom attribute, I get error SQLSTATE[42S22]: Column not found: 1054 ...
0 votes
2 answers
2k views

Custom customer attribute not showing on frontend

I've seen this question many times, but all the solutions I've tried didn't work. I've generated a module that creates three custom attributes in customer's information. Since I'm new to Magento (...
0 votes
0 answers
18 views

magento 2 change multiselct to ui select for custom customer attribute

I want to create a UI select in the customer account area in ADMIN for custom attributes. something like this -> https://dolphinwebsolution.com/magento-2-add-ui-select-component-with-search-filter-...
-1 votes
2 answers
1k views

Adding custom customer attribute with declarative schema and db_schema

I added a custom attribute in de customer_entity table with db_schema.xml. I can get the value of that attribute with getdata('debtor_id') but I can't set it with setData('debtor_id' ,2). Did I miss a ...
0 votes
2 answers
3k views

Call to undefined method Magento\Customer\Model\ResourceModel\CustomerRepository\Interceptor::getByEmail() magento2

I am trying to update custom attribute in magento2 but i am getting error while running this <?php namespace test\Org\Controller\Result; use Magento\Framework\App\Action\Context; ...
3 votes
3 answers
2k views

Only allow 6 digit number as customer password

Is there a way to make magento 2 only allow 6 digit number format as customer password?
0 votes
1 answer
92 views

Magento2: Issue with the customer custom attribute and custom tab in product view

This is the code snippet responsible for adding new attribute public function createAllowRequestSampleCustomerAttribute($setup) { $code = 'allow_request_sample'; /** @...
0 votes
1 answer
51 views

Customer custom attributes do not save data to customer_entity table

I'm creating a rest API and I need to add a custom columns to the customer_entity table and save the value in that fields within API request. Сreated new attributes in the customer_entity table using ...
1 vote
1 answer
218 views

Custom customer attribute not save 2.4.6

I have created customer attribute with custom source model, I am getting below error , the same code is working fine with 2.4.5 I am getting below error while saving in admin Attribute attribute_code ...
0 votes
2 answers
268 views

Get customer custom attribute value without loading the customer

I'm trying to get custom customer attribute value (for attribute code abn_no) without loading the customer but not able to find any way to get it. Is there any way to get custom customer attribute ...
6 votes
1 answer
9k views

Magento 2 : How to know "used_in_forms" param of eav attribute for a form?

I was wondering if there is a full proof method for finding all used_in_forms params of eav attribute which is specified in InstallData.php to create all kind of attributes for a form or maybe ...
0 votes
2 answers
651 views

How to make custom customer attribute filterable in the customer grid?

I've made a patch and this is the code for creating my customer custom attribute: public function apply() { $this->moduleDataSetup->getConnection()->startSetup(); /** @var ...
0 votes
0 answers
32 views

Magento Customer Attribute Value Multi Website Issue

I have multi website setup and, I have create one Custom Customer Attribute named "mobile_number", that shows on create account form at frontend. Now the issue is while creating customer in ...
0 votes
1 answer
65 views

Magento 2 How to add Customer address attribute value under set Shipping Address on Checkout Page

I have create one custom field on Customer address form and save it's value on customer address attribute in customer_address_entity_text table. Now, When I go to Checkout Page then need to display ...
3 votes
2 answers
4k views

how to get customer attributes in magento2?

I'm displaying customer attributes on Multiselect Textbox in General Tab. In Magento 1.0 simply getting Customer Attributes by using below code public function toOptionArray() { $...
5 votes
1 answer
382 views

Magento 2 : How to upload file using Rest Api

I want to upload file using REST Api. As per my reserch there are two ways for this. by passing base64 encoded string into form-data by passing file upload parameter into form-data But I am confused ...
0 votes
0 answers
6 views

How to show link instead of text field in customer edit form in admin?

I have created a customer attribute, where customers add a url of there store. I want to show that url as a clickable link in admin customers form. Is this possible and how?
4 votes
8 answers
4k views

“Type Error occurred when creating object: Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Config”

I have migrated from ver 1.9 to 2.3
3 votes
2 answers
735 views

Magento 2 How can I add State and Country attribute for customer in Admin?

How can I achieve State and Country field functionality in Admin under customer Account Information? I have referred this link to create in front-end https://magecomp.com/blog/create-country-...
0 votes
3 answers
96 views

How to persist the value of a custom field on the customer_entity table?

I'm new to Magento 2 and to this forum. I'm trying to add a newsletter subscription on the customer menu, just after the core one. For that, i created a module "ACME_Newsletter" I added a ...
1 vote
3 answers
634 views

Add multiple customer attribute fields in Magento registration form

I am trying to add 2 customer attribute fields in my Magento registration form. The input names are the same in the register.phtml as in the install-1.0.0.php file. However I think there is something ...
1 vote
0 answers
46 views

How to create dynamicRows to the custom customer attribute Magento 2

I have created a custom dynamic row in the customer information tab. but it is not saving data in the table.
0 votes
1 answer
1k views

How to add Customer custom attributes and address custom attributes

I had many issues trying to add new customer account and address fields. Sometimes it wasn't showing up on the customer adminhtml form and on other times won't save the value.
0 votes
2 answers
1k views

How to get customer custom dropdown value with text in magento2?

I have created customer custom attribute 'segments' with the below options: Options: SME, Reseller, Others I want get segments value with text based on the customer id in magento2. How to achieve ...
1 vote
2 answers
3k views

How to set customer custom attribute in magento 2?

I have created some custom attributes for a customer in magento2 community edition, I have used below code to set in my custom code use Magento\Customer\Api\AccountManagementInterface; use Magento\...
3 votes
1 answer
2k views

magento 2 Save custom attribute customer not working

I am using magento 2.1.4 I have created some attribute for customer When i save, this attribute not woking Pls help me http://prntscr.com/esncjv Thanks
1 vote
1 answer
2k views

Custom Customer Attribute field data not showing in Customer Account Information

I have added the field "Favorite Color" to the Customer entity and added it to the registration form. The field properly stores data, as I can see when logging in as Admin and checking in ...
1 vote
2 answers
763 views

Getting a customer custom attribute label not value

I know I can do the following $customerId = 1; $customer = $this->customerRepositoryInterface->getById($customerId); $code = $customer->getCustomAttribute('attribute_code')->...
2 votes
1 answer
87 views

unable to get the Customer Custom Attribute value in customer_register_success event in magento 2

In my project a custom customer attribute was using and save the value in the table on customer registration. Attribute id was phone_number I want to get this phone number value and send an sms using ...
1 vote
0 answers
315 views

How to upload image/file using custom customer attribute with Rest API Magento 2?

I have create one custom customer attribute with file type. I want to upload file using rest API and want to store it to custom media path. How to upload file is with customer registration API?
0 votes
1 answer
559 views

How to add Multiple validation rule

I have to add three validation rule and as you see below code works well for one rule : validation-mixin.js define([ 'jquery' ], function ($) { "use strict"; console.log('this is ...
0 votes
1 answer
47 views

How to create a custom address attribute for customer and show that in edit address in admin?

I want to create a custom customer address attribute called customer_custom_id in the below address.( check the below image.). how can I do that?
2 votes
3 answers
4k views

Magento 2 - Updating custom customer attribute programmatically

I am trying to update a custom customer attribute, I have the following code <?php namespace Vendor\Module\Plugin; use Magento\Customer\Model\ResourceModel\CustomerRepository; use Magento\...
1 vote
1 answer
139 views

add categories tree to customer eav attribute

I'm trying to create an EAV attribute for the customer, and I need the input to be the product categories tree like the following image: Is this acheivable? And how? please.
2 votes
1 answer
380 views

Add Attribute to All Magento Customers, preferably an Object

Before continuing I would like to state that I have been looking for over a week through StackOverFlow, StackExchange, Google, and Alan Storm blogs. Please don't link to another post I've most likely ...
1 vote
2 answers
175 views

Showing customer eav attrribute in product page always shows cached data

I've created a customer EAV attribute and trying to show this attribute on the product details page but it always returns chaced data till I run bin/magento cache:flush full_page. I've tried to use ...
0 votes
1 answer
360 views

How can we add custom customer attributes in admin grid

I have created an attribute type: Test but I want to display in the grid customer. https://prnt.sc/aRyraGEP7kKf
1 vote
2 answers
4k views

Magento 2 does not allow Special characters in First Name & Last name even though the Input Validation is None

In my magento setup I am not able to insert special characters for customer First name and Last name. The Input Validation for Customer Attribute First Name and Last Name is NONE. But still Magento 2 ...
3 votes
4 answers
11k views

How do I add customer attributes in Magento 2 CE?

In Magento 2 CE we have to add new attributes with Coding? It's not provided by default? I have looked in to http://www.extensions.sashas.org/blog/magento-2-make-customer-attribute.html I would like ...
0 votes
1 answer
250 views

Magento 2 get custom customer attribute displayed value

I'm using the module Amasty's customer Attributes to create custom customer attributes, I like to get custom attribute displayed value but i got the option value. I like to get the value in data-title ...

1
2 3 4 5
10