0

How to limit the address on checkout/#shipping page. like all the address from cutomer_address_entity are listed in this page. but how to show only one address.

I have added a quote programmatically, and add address for that quote programmatically. now i want to show that quote address (which i added against that quote id programmatically) show on shipping page. instead it shows all the addresses from customer_address_entity table.

0

For that, you have to override the default Magento below file.

vendor\magento\module-checkout\view\frontend\web\js\view\shipping-address\list.js

inside this file add the below logic.

initChildren: function () {

        if(addressList().length > 0){
           // Add your logic as per your requirement.
            this.createRendererComponent(addressList()[0],this);
        }
        else{
            _.each(addressList(), this.createRendererComponent, this);
        }

        return this;

I hope it helps!

  • But it will show only the first address from list. i have update my question. Please have a look. – Ali Raza Oct 29 '20 at 7:20

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.