cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2-How to update address list (data:elems) in shipping-address/list.html ?

Highlighted

Magento 2-How to update address list (data:elems) in shipping-address/list.html ?

I have added edit link to all the address in shipping step. I am able to update, and the changes are saved in the database but the changes are reflected in the front-end only when the page is reloaded. How to update the address list so that the changes are reflected in the front-end as soon as the update button is clicked .

 updateAddress: function () {
            var addressData,
            newShippingAddress,
            addressId,
            this.source.set('params.invalid', false);
            this.triggerShippingDataValidateEvent();

            if (!this.source.get('params.invalid')) {
                addressData = this.source.get('shippingAddress');
                 addressId=$('input[name=shippingAddressId]').val();
                if(addressId){
                    var Data = {"addressData": addressData, "addressId": addressId};
                    fullScreenLoader.startLoader();
                    storage.post(
                        'checkout/address/update', 
                        JSON.stringify(Data),
                        true
                        ).done(
                        function (response) {
                            console.log(response);
                            console.log("updated");
                            fullScreenLoader.stopLoader();
                            
                        }
                        ).fail(
                        function (response) {
                            console.log("failure");
                            console.log(response);
                            fullScreenLoader.stopLoader();
                        }
                        );
                        this.isFormVisible(false);
                }
        }
    },
4 REPLIES 4
Highlighted

Re: Magento 2-How to update address list (data:elems) in shipping-address/list.html ?

Any any knows?


Highlighted

Re: Magento 2-How to update address list (data:elems) in shipping-address/list.html ?

Now I get it

 

vendor/magento/module-checkout/view/frontend/web/js/action/create-shipping-address.js

Refer this file you get some idea.

 

Re: Magento 2-How to update address list (data:elems) in shipping-address/list.html ?

Ya , found the solution.

Highlighted

Re: Magento 2-How to update address list (data:elems) in shipping-address/list.html ?

yes