cancel
Showing results for 
Search instead for 
Did you mean: 

I enabled edit button in checkout for logged-in users

I enabled edit button in checkout for logged-in users

I enabled edit  button in checkout for logged-in users . when a user click on the edit button it will shows a pop-up with first and last name. But I want it need to display existing address in the corresponding fields such as city, region,postal code etc

1 REPLY 1

Re: I enabled edit button in checkout for logged-in users

You can done this by edit the following file

vendor/magento/module-checkout/view/frontend/web/js/checkout-data.js

In this file you can edit the getShippingAddressFromData: function (){  .... }.

The code for get existing address details are

var customerData = window.customerData;
var customerAddress = customerData.addresses[0];

$('[name="company"]').val(customerAddress.company)

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

$('[name="postcode"]').val(customerAddress.postcode)