Magento 2 how to add city dropdownCity dropdown at checkout magento 2How to add city (not state!) in magento?Remove Country Dropdown at Frontendmagento text field add dropdown value from some other databaseDropdown for weightHow to create custom dropdown attribute for customer in magentoHow to translate city/region dropdown on magento 2Magento 2 Rest API - how do I add values to dropdown product attributeMagento 2.1 Create a filter in the product grid by new attributeMagento 2: how to add City in dropdown?Checkout shipping fields different than default

How to pass a regex when finding a directory path in bash?

Building a road to escape Earth's gravity by making a pyramid on Antartica

Should I "tell" my exposition or give it through dialogue?

How to make a setting relevant?

What's the correct term for a waitress in the Middle Ages?

Do manufacturers try make their components as close to ideal ones as possible?

Z80N multiply compared to MC68000

Efficiently merge lists chronologically without duplicates?

Is the decompression of compressed and encrypted data without decryption also theoretically impossible?

Why did Hela need Heimdal's sword?

C SIGINT signal in Linux

PC video game involving floating islands doing aerial combat

Function to extract float from different price patterns

Their answer is discrete, mine is continuous. They baited me into the wrong answer. I have a P Exam question

What is the advantage of carrying a tripod and ND-filters when you could use image stacking instead?

My coworkers think I had a long honeymoon. Actually I was diagnosed with cancer. How do I talk about it?

How is it possible that Gollum speaks Westron?

What happened to all the nuclear material being smuggled after the fall of the USSR?

Can a magnetic field of an object be stronger than its gravity?

Implement Homestuck's Catenative Doomsday Dice Cascader

Through what methods and mechanisms can a multi-material FDM printer operate?

Java guess the number

Company did not petition for visa in a timely manner. Is asking me to work from overseas, but wants me to take a paycut

How is TD(0) method helpful? What good does it do?



Magento 2 how to add city dropdown


City dropdown at checkout magento 2How to add city (not state!) in magento?Remove Country Dropdown at Frontendmagento text field add dropdown value from some other databaseDropdown for weightHow to create custom dropdown attribute for customer in magentoHow to translate city/region dropdown on magento 2Magento 2 Rest API - how do I add values to dropdown product attributeMagento 2.1 Create a filter in the product grid by new attributeMagento 2: how to add City in dropdown?Checkout shipping fields different than default






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















i am trying to city as dropdown in only checkout page with following script in MagentoCheckoutBlockCartLayoutProcessor.php



$elements = [
'city' => [
'visible' => true,
'formElement' => 'select',
'label' => __('City'),
'options' => [
[
'value' => '',
'label' => 'Please Select',
],
[
'value' => '1',
'label' => 'First Option',
]
],
'value' => null
],
'country_id' => [
'visible' => true,
'formElement' => 'select',
'label' => __('Country'),
'options' => [],
'value' => null
],
'region_id' => [
'visible' => true,
'formElement' => 'select',
'label' => __('State/Province'),
'options' => [],
'value' => null
],
'postcode' => [
'visible' => true,
'formElement' => 'input',
'label' => __('Zip/Postal Code'),
'value' => null
]
];


but still it's showing as input text filed. Any one can please suggest best solution










share|improve this question






















  • Toy can find here answer for this question, magento.stackexchange.com/a/121659/31830

    – WISAM HAKIM
    Apr 15 '18 at 9:28











  • I am on the same problem have you found any solution please?

    – CDzWebDev
    Apr 15 '18 at 11:54

















1















i am trying to city as dropdown in only checkout page with following script in MagentoCheckoutBlockCartLayoutProcessor.php



$elements = [
'city' => [
'visible' => true,
'formElement' => 'select',
'label' => __('City'),
'options' => [
[
'value' => '',
'label' => 'Please Select',
],
[
'value' => '1',
'label' => 'First Option',
]
],
'value' => null
],
'country_id' => [
'visible' => true,
'formElement' => 'select',
'label' => __('Country'),
'options' => [],
'value' => null
],
'region_id' => [
'visible' => true,
'formElement' => 'select',
'label' => __('State/Province'),
'options' => [],
'value' => null
],
'postcode' => [
'visible' => true,
'formElement' => 'input',
'label' => __('Zip/Postal Code'),
'value' => null
]
];


but still it's showing as input text filed. Any one can please suggest best solution










share|improve this question






















  • Toy can find here answer for this question, magento.stackexchange.com/a/121659/31830

    – WISAM HAKIM
    Apr 15 '18 at 9:28











  • I am on the same problem have you found any solution please?

    – CDzWebDev
    Apr 15 '18 at 11:54













1












1








1








i am trying to city as dropdown in only checkout page with following script in MagentoCheckoutBlockCartLayoutProcessor.php



$elements = [
'city' => [
'visible' => true,
'formElement' => 'select',
'label' => __('City'),
'options' => [
[
'value' => '',
'label' => 'Please Select',
],
[
'value' => '1',
'label' => 'First Option',
]
],
'value' => null
],
'country_id' => [
'visible' => true,
'formElement' => 'select',
'label' => __('Country'),
'options' => [],
'value' => null
],
'region_id' => [
'visible' => true,
'formElement' => 'select',
'label' => __('State/Province'),
'options' => [],
'value' => null
],
'postcode' => [
'visible' => true,
'formElement' => 'input',
'label' => __('Zip/Postal Code'),
'value' => null
]
];


but still it's showing as input text filed. Any one can please suggest best solution










share|improve this question














i am trying to city as dropdown in only checkout page with following script in MagentoCheckoutBlockCartLayoutProcessor.php



$elements = [
'city' => [
'visible' => true,
'formElement' => 'select',
'label' => __('City'),
'options' => [
[
'value' => '',
'label' => 'Please Select',
],
[
'value' => '1',
'label' => 'First Option',
]
],
'value' => null
],
'country_id' => [
'visible' => true,
'formElement' => 'select',
'label' => __('Country'),
'options' => [],
'value' => null
],
'region_id' => [
'visible' => true,
'formElement' => 'select',
'label' => __('State/Province'),
'options' => [],
'value' => null
],
'postcode' => [
'visible' => true,
'formElement' => 'input',
'label' => __('Zip/Postal Code'),
'value' => null
]
];


but still it's showing as input text filed. Any one can please suggest best solution







magento-2.1 dropdown-attribute address






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 13 '17 at 19:15









RameshRamesh

487525




487525












  • Toy can find here answer for this question, magento.stackexchange.com/a/121659/31830

    – WISAM HAKIM
    Apr 15 '18 at 9:28











  • I am on the same problem have you found any solution please?

    – CDzWebDev
    Apr 15 '18 at 11:54

















  • Toy can find here answer for this question, magento.stackexchange.com/a/121659/31830

    – WISAM HAKIM
    Apr 15 '18 at 9:28











  • I am on the same problem have you found any solution please?

    – CDzWebDev
    Apr 15 '18 at 11:54
















Toy can find here answer for this question, magento.stackexchange.com/a/121659/31830

– WISAM HAKIM
Apr 15 '18 at 9:28





Toy can find here answer for this question, magento.stackexchange.com/a/121659/31830

– WISAM HAKIM
Apr 15 '18 at 9:28













I am on the same problem have you found any solution please?

– CDzWebDev
Apr 15 '18 at 11:54





I am on the same problem have you found any solution please?

– CDzWebDev
Apr 15 '18 at 11:54










1 Answer
1






active

oldest

votes


















0














You are working on wrong layoutProcessor. Please, read this documentation which will explain you how to modify existing field on checkout:
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_field.html



You should register your own layoutProcessor and modify layout array or, for tests purpose, you can modify vendor/magento/module-checkout/Block/Checkout/LayoutProcessor.php which is the proper class to work with.






share|improve this answer























  • Bartosz, i think that documentation informs that "how to add new field in checkout not exiting field

    – Ramesh
    Dec 14 '17 at 9:37











  • Process is the same but instead of adding new you have to modify existing in your processor. So, in practice, instead of adding new data to layout array modify the part of array which holds city component data. Of course, there is a little bit more in docs due to a fact it is about creating a new field BUT a little more knowledge will not hurt anyone.

    – Bartosz Herba
    Dec 14 '17 at 9:51











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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f205706%2fmagento-2-how-to-add-city-dropdown%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









0














You are working on wrong layoutProcessor. Please, read this documentation which will explain you how to modify existing field on checkout:
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_field.html



You should register your own layoutProcessor and modify layout array or, for tests purpose, you can modify vendor/magento/module-checkout/Block/Checkout/LayoutProcessor.php which is the proper class to work with.






share|improve this answer























  • Bartosz, i think that documentation informs that "how to add new field in checkout not exiting field

    – Ramesh
    Dec 14 '17 at 9:37











  • Process is the same but instead of adding new you have to modify existing in your processor. So, in practice, instead of adding new data to layout array modify the part of array which holds city component data. Of course, there is a little bit more in docs due to a fact it is about creating a new field BUT a little more knowledge will not hurt anyone.

    – Bartosz Herba
    Dec 14 '17 at 9:51















0














You are working on wrong layoutProcessor. Please, read this documentation which will explain you how to modify existing field on checkout:
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_field.html



You should register your own layoutProcessor and modify layout array or, for tests purpose, you can modify vendor/magento/module-checkout/Block/Checkout/LayoutProcessor.php which is the proper class to work with.






share|improve this answer























  • Bartosz, i think that documentation informs that "how to add new field in checkout not exiting field

    – Ramesh
    Dec 14 '17 at 9:37











  • Process is the same but instead of adding new you have to modify existing in your processor. So, in practice, instead of adding new data to layout array modify the part of array which holds city component data. Of course, there is a little bit more in docs due to a fact it is about creating a new field BUT a little more knowledge will not hurt anyone.

    – Bartosz Herba
    Dec 14 '17 at 9:51













0












0








0







You are working on wrong layoutProcessor. Please, read this documentation which will explain you how to modify existing field on checkout:
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_field.html



You should register your own layoutProcessor and modify layout array or, for tests purpose, you can modify vendor/magento/module-checkout/Block/Checkout/LayoutProcessor.php which is the proper class to work with.






share|improve this answer













You are working on wrong layoutProcessor. Please, read this documentation which will explain you how to modify existing field on checkout:
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_field.html



You should register your own layoutProcessor and modify layout array or, for tests purpose, you can modify vendor/magento/module-checkout/Block/Checkout/LayoutProcessor.php which is the proper class to work with.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 13 '17 at 19:46









Bartosz HerbaBartosz Herba

95518




95518












  • Bartosz, i think that documentation informs that "how to add new field in checkout not exiting field

    – Ramesh
    Dec 14 '17 at 9:37











  • Process is the same but instead of adding new you have to modify existing in your processor. So, in practice, instead of adding new data to layout array modify the part of array which holds city component data. Of course, there is a little bit more in docs due to a fact it is about creating a new field BUT a little more knowledge will not hurt anyone.

    – Bartosz Herba
    Dec 14 '17 at 9:51

















  • Bartosz, i think that documentation informs that "how to add new field in checkout not exiting field

    – Ramesh
    Dec 14 '17 at 9:37











  • Process is the same but instead of adding new you have to modify existing in your processor. So, in practice, instead of adding new data to layout array modify the part of array which holds city component data. Of course, there is a little bit more in docs due to a fact it is about creating a new field BUT a little more knowledge will not hurt anyone.

    – Bartosz Herba
    Dec 14 '17 at 9:51
















Bartosz, i think that documentation informs that "how to add new field in checkout not exiting field

– Ramesh
Dec 14 '17 at 9:37





Bartosz, i think that documentation informs that "how to add new field in checkout not exiting field

– Ramesh
Dec 14 '17 at 9:37













Process is the same but instead of adding new you have to modify existing in your processor. So, in practice, instead of adding new data to layout array modify the part of array which holds city component data. Of course, there is a little bit more in docs due to a fact it is about creating a new field BUT a little more knowledge will not hurt anyone.

– Bartosz Herba
Dec 14 '17 at 9:51





Process is the same but instead of adding new you have to modify existing in your processor. So, in practice, instead of adding new data to layout array modify the part of array which holds city component data. Of course, there is a little bit more in docs due to a fact it is about creating a new field BUT a little more knowledge will not hurt anyone.

– Bartosz Herba
Dec 14 '17 at 9:51

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f205706%2fmagento-2-how-to-add-city-dropdown%23new-answer', 'question_page');

);

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







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form