I want to show only 5 shipping address on this page, followed this below link Magento 2 - Checkout. Remove “New Address” button from billing/shipping address with module or theme. enter image description here


// this.isNewAddressAdded(hasNewAddress);
            if (addressList().length <= 5) {

I've added mixin this way /app/code/Vendor/Checkout/view/frontend/requirejs-config.js

var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/view/shipping': {
                'Vendor_Checkout/js/view/shipping': true

1 Answer 1


You need to modify isNewAddressAdded() logic in shipping.js. The following code will help you.

if (addressList().length >= 5) {


if (addressList().length >= 5) {
        } else {

[Update (2021-07-12)]

Add following code snippet on shipping.js before initialize method:

isVisibleAddNewAddress:  ko.observable(true),

Now in initialize method add the following code:

var addressCount = parseInt(addressList().length);
if (addressCount >= 5) {

Now open shipping.html add the following code:

<if args="isVisibleAddNewAddress()">
    <button type="button"
            class="action action-show-popup"
        <span translate="'New Address'" />

Clear your browser js cache.

  • Where I need to put this condition? Commented Jul 9, 2021 at 15:15
  • Create a mixin or copy shipping.js in your theme (github.com/magento/magento2/blob/2.4-develop/app/code/Magento/…), Add above condition in initialize method. E.x the following line: github.com/magento/magento2/blob/2.4-develop/app/code/Magento/…
    – Sohel Rana
    Commented Jul 9, 2021 at 15:19
  • Should I removed the line which is already there "this.isNewAddressAdded(hasNewAddress);" I keep the above code before this line but I can not found any change there? Commented Jul 9, 2021 at 15:44
  • Hi Sohel Thanks for your help after modified the logic still I'm getting the same response, Can you have a look once! // this.isNewAddressAdded(hasNewAddress); if (addressList().length <= 5) { this.isNewAddressAdded(true); } Commented Jul 9, 2021 at 16:46
  • Clear your static content and clear your browser JS cache
    – Sohel Rana
    Commented Jul 10, 2021 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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