Magento 2 - Custom Customer attribute in order create select customer grid
I am trying to add a custom column in sales create order customer grid.
When admin trying to place order from back end ,after create order button click we get a customer grid .
I have added a new column Company Name to this grid using below code in
sales_order_create_customer_block.xml
<block class="MagentoBackendBlockWidgetGridColumn" name="adminhtml.customer.grid.columnSet.company_name" as="company_name">
<arguments>
<argument name="header" xsi:type="string" translate="true">Company Name</argument>
<argument name="index" xsi:type="string">company_name</argument>
<argument name="align" xsi:type="string">center</argument>
</arguments>
</block>
Here Company Name is a custom customer attribute I have created .
After adding this I am getting the company name in this grid.
But the company name does not show at first load.
In the above screenshot for customer Id 66, I have set the company name still its displayed none.When I filter it by clicking on company name header it filters and then the company name is displayed for each customer and properly.
And when I reload the page it again displays nothing and I have to filter it again to display it .
I tried giving a different customer field gender in the xml and I am getting Boolean values as expected and no need of filter needed to display it like in case of my custom customer attribute.
Is there any that I have missed out in configuring this ?
magento2 layout attributes grid customer-grid
add a comment |
I am trying to add a custom column in sales create order customer grid.
When admin trying to place order from back end ,after create order button click we get a customer grid .
I have added a new column Company Name to this grid using below code in
sales_order_create_customer_block.xml
<block class="MagentoBackendBlockWidgetGridColumn" name="adminhtml.customer.grid.columnSet.company_name" as="company_name">
<arguments>
<argument name="header" xsi:type="string" translate="true">Company Name</argument>
<argument name="index" xsi:type="string">company_name</argument>
<argument name="align" xsi:type="string">center</argument>
</arguments>
</block>
Here Company Name is a custom customer attribute I have created .
After adding this I am getting the company name in this grid.
But the company name does not show at first load.
In the above screenshot for customer Id 66, I have set the company name still its displayed none.When I filter it by clicking on company name header it filters and then the company name is displayed for each customer and properly.
And when I reload the page it again displays nothing and I have to filter it again to display it .
I tried giving a different customer field gender in the xml and I am getting Boolean values as expected and no need of filter needed to display it like in case of my custom customer attribute.
Is there any that I have missed out in configuring this ?
magento2 layout attributes grid customer-grid
add a comment |
I am trying to add a custom column in sales create order customer grid.
When admin trying to place order from back end ,after create order button click we get a customer grid .
I have added a new column Company Name to this grid using below code in
sales_order_create_customer_block.xml
<block class="MagentoBackendBlockWidgetGridColumn" name="adminhtml.customer.grid.columnSet.company_name" as="company_name">
<arguments>
<argument name="header" xsi:type="string" translate="true">Company Name</argument>
<argument name="index" xsi:type="string">company_name</argument>
<argument name="align" xsi:type="string">center</argument>
</arguments>
</block>
Here Company Name is a custom customer attribute I have created .
After adding this I am getting the company name in this grid.
But the company name does not show at first load.
In the above screenshot for customer Id 66, I have set the company name still its displayed none.When I filter it by clicking on company name header it filters and then the company name is displayed for each customer and properly.
And when I reload the page it again displays nothing and I have to filter it again to display it .
I tried giving a different customer field gender in the xml and I am getting Boolean values as expected and no need of filter needed to display it like in case of my custom customer attribute.
Is there any that I have missed out in configuring this ?
magento2 layout attributes grid customer-grid
I am trying to add a custom column in sales create order customer grid.
When admin trying to place order from back end ,after create order button click we get a customer grid .
I have added a new column Company Name to this grid using below code in
sales_order_create_customer_block.xml
<block class="MagentoBackendBlockWidgetGridColumn" name="adminhtml.customer.grid.columnSet.company_name" as="company_name">
<arguments>
<argument name="header" xsi:type="string" translate="true">Company Name</argument>
<argument name="index" xsi:type="string">company_name</argument>
<argument name="align" xsi:type="string">center</argument>
</arguments>
</block>
Here Company Name is a custom customer attribute I have created .
After adding this I am getting the company name in this grid.
But the company name does not show at first load.
In the above screenshot for customer Id 66, I have set the company name still its displayed none.When I filter it by clicking on company name header it filters and then the company name is displayed for each customer and properly.
And when I reload the page it again displays nothing and I have to filter it again to display it .
I tried giving a different customer field gender in the xml and I am getting Boolean values as expected and no need of filter needed to display it like in case of my custom customer attribute.
Is there any that I have missed out in configuring this ?
magento2 layout attributes grid customer-grid
magento2 layout attributes grid customer-grid
edited Nov 13 '18 at 7:08
Melvin
asked Nov 2 '18 at 19:52
MelvinMelvin
72213
72213
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Im facing the same issue. Did you get any solution for this?
I tried one approach, that is I made default_sort as company_name and it worked but if we sort with any different column, this wont work.
<arguments>
<argument name="default_sort" xsi:type="string">company_name</argument>
</arguments>
FYI, even the values aren't displayed but if we search for the company name then the results are fetching properly.
Thanks
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f248927%2fmagento-2-custom-customer-attribute-in-order-create-select-customer-grid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Im facing the same issue. Did you get any solution for this?
I tried one approach, that is I made default_sort as company_name and it worked but if we sort with any different column, this wont work.
<arguments>
<argument name="default_sort" xsi:type="string">company_name</argument>
</arguments>
FYI, even the values aren't displayed but if we search for the company name then the results are fetching properly.
Thanks
add a comment |
Im facing the same issue. Did you get any solution for this?
I tried one approach, that is I made default_sort as company_name and it worked but if we sort with any different column, this wont work.
<arguments>
<argument name="default_sort" xsi:type="string">company_name</argument>
</arguments>
FYI, even the values aren't displayed but if we search for the company name then the results are fetching properly.
Thanks
add a comment |
Im facing the same issue. Did you get any solution for this?
I tried one approach, that is I made default_sort as company_name and it worked but if we sort with any different column, this wont work.
<arguments>
<argument name="default_sort" xsi:type="string">company_name</argument>
</arguments>
FYI, even the values aren't displayed but if we search for the company name then the results are fetching properly.
Thanks
Im facing the same issue. Did you get any solution for this?
I tried one approach, that is I made default_sort as company_name and it worked but if we sort with any different column, this wont work.
<arguments>
<argument name="default_sort" xsi:type="string">company_name</argument>
</arguments>
FYI, even the values aren't displayed but if we search for the company name then the results are fetching properly.
Thanks
answered 41 mins ago
Harshith SHarshith S
166
166
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f248927%2fmagento-2-custom-customer-attribute-in-order-create-select-customer-grid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown