Is it possible to just fill the shipping address fields with my own values?

For example: I want city field to be filled with My City when an event occurs on the checkout page. I know the checkout page uses Knockout JS that but I haven't figured out how to pass values to the fields themselves.

So far I have jquery running on the checkout page but writing code like:

$('input[name="shippingAddress.city"]').val("My city");

This does not work.

I appreciate any help that anyone can give.


2 Answers 2


Yes, It is possible. It works fine in my case.

require(['jquery'], function($){

    var onDomIsRendered = function(domString) {
          return new Promise(function(resolve, reject) {
            function waitUntil() {
              setTimeout(function() {
                if($(domString).length > 0){
                }else {
              }, 4000);
            //start the loop

            $('[name="city"]').val('My city');

Because Shipping address from update value by event keyup so you can try:

$('input[name="shippingAddress.city"]').val("My city").keyup();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.