Magento 2 Checkout – Remove New Address Button from Billing/Shipping Address

billing-addresscheckoutmagento2magento2.3shipping-address

I want to disable the "new address" button from checkout page in Magento 2.
Will it be easy with the theme or create a new module?

Magento 2 – Checkout. Remove the “New Address” button from billing/shipping address with module or theme.

Please help.

Best Answer

1) Override shipping.html

-> With Custom Theme:

Copy shipping.html from vendor/magento/module-checkout/view/frontend/web/template/shipping.html

to app/design/frontend/{vendor}/{theme}/Magento_Checkout/web/template/shipping.html

-> With Custom Module:

Create requirejs-config.js app/code/{Vendor}/{Module}/view/frontend/requirejs-config.js

var config = {
    map: {
        '*': {
          'Magento_Checkout/template/shipping.html': 
              'Vendor_Module/template/shipping.html'
        }
  }
};

2) Now remove following html from shipping.html

<!-- Address form pop up -->
<if args="!isFormInline">
    <button type="button"
            class="action action-show-popup"
            click="showFormPopUp"
            visible="!isNewAddressAdded()">
        <span translate="'New Address'" />
    </button>
    <div id="opc-new-shipping-address"
         visible="isFormPopUpVisible()"
         render="shippingFormTemplate" />
</if>

3) Now run the following commands:

php bin/magento setup:static-content:deploy

php bin/magento setup:upgrade

Related Topic