1

I want to remove New Address option from Checkout page in magento 2.4.3. https://prnt.sc/YOkaWUvochUd

Can anyone help?

3
  • Which checkout extension you are using? What is your checkout extension path? It will be something like this : app/code/Vendor/CheckoutModule or vendor/vendorName/checkout-module-name
    – Tu Van
    Commented Oct 28, 2022 at 13:59
  • Run this command from the root folder and paste the result here, I'll help you: grep -r "New Address" app/code vendor
    – Tu Van
    Commented Oct 28, 2022 at 14:53
  • I am using Amsty Checkout Commented Oct 31, 2022 at 6:41

2 Answers 2

1

From your screenshot, I found you are using Magepzala One Step Checkout module, but you say you are using Amasty Checkout module I'll write the instruction for both cases:

Case 1: You using Amasty One Step Checkout module:

Solution 1: I strongly recommend you hide New Address option from Checkout page by CSS to keep your site easier to upgrade Amasty One Step Checkout module in the future. To do that, take the following steps:

Step 1: Create app/design/frontend/<Vendor>/<theme>/Amasty_CheckoutCore/web/css/source/_extend.less file if it does not exists.

And adding the below content:

& when (@media-common = true) {
    #checkout-step-shipping {
        .action-show-popup {
            display: none;
        }
    }
}

Step 2: Re-deploy static content (remember to change your Vendor name and Theme name in the commands:

rm -r var/view_preprocessed/pub/static/frontend/<Vendor>/<theme>
rm -r pub/static/frontend/<Vendor>/<theme>
bin/magento setup:static-content:deploy -f --area frontend --theme <Vendor>/<theme> --no-parent

Done.

Solution 2: If you still want to remove New Address option from Checkout page, take the following steps:

Step 1: Copy view/frontend/web/template/onepage/shipping/address.html in Amasty_CheckoutCore module in vendor (it will be something like this: vendor/amasty/checkout-core/view/frontend/web/template/onepage/shipping/address.html) to

app/design/frontend/<Vendor>/<theme>/Amasty_CheckoutCore/web/template/onepage/shipping/address.html

Step 2: Open app/design/frontend/<Vendor>/<theme>/Amasty_CheckoutCore/web/template/onepage/shipping/address.html, remove the below code:

<!-- Address form pop up -->
<button type="button"
        data-bind="click: showFormPopUp, visible: !isNewAddressAdded()"
        class="action action-show-popup amcheckout-button -new-address">
    <span data-bind="i18n: 'New Address'"></span></button>

Step 3: Re-deploy static content (remember to change your Vendor name and Theme name in the commands:

rm -r var/view_preprocessed/pub/static/frontend/<Vendor>/<theme>
rm -r pub/static/frontend/<Vendor>/<theme>
bin/magento setup:static-content:deploy -f --area frontend --theme <Vendor>/<theme> --no-parent

Done.

====================

Case 2: You using Mageplaza One Step Checkout module:

Solution 1: I strongly recommend you hide New Address option from Checkout page by CSS to keep your site easier to upgrade Magepzala One Step Checkout module in the future. To do that, take the following steps:

Step 1: Create app/design/frontend/<Vendor>/<theme>/Mageplaza_Osc/web/css/source/_extend.less file if it does not exists.

And adding the below content:

& when (@media-common = true) {
    #checkout-step-shipping {
        .action-show-popup {
            display: none;
        }
    }
}

Step 2: Re-deploy static content (remember to change your Vendor name and Theme name in the commands:

rm -r var/view_preprocessed/pub/static/frontend/<Vendor>/<theme>
rm -r pub/static/frontend/<Vendor>/<theme>
bin/magento setup:static-content:deploy -f --area frontend --theme <Vendor>/<theme> --no-parent

Done.

Solution 2: If you still want to remove New Address option from Checkout page, take the following steps:

Step 1: Copy app/code/Mageplaza/Osc/view/frontend/web/template/container/address/shipping-address.html to

app/design/frontend/<Vendor>/<theme>/Mageplaza_Osc/web/template/container/address/shipping-address.html

Step 2: Open app/design/frontend/<Vendor>/<theme>/Mageplaza_Osc/web/template/container/address/shipping-address.html, remove the below code:

<!-- Address form pop up -->
<!-- ko if: (!isFormInline) -->
<button type="button"
        data-bind="click: showFormPopUp, visible: !isNewAddressAdded()"
        class="action action-show-popup">
    <span data-bind="i18n: 'New Address'"></span></button>

Step 3: Re-deploy static content (remember to change your Vendor name and Theme name in the commands:

rm -r var/view_preprocessed/pub/static/frontend/<Vendor>/<theme>
rm -r pub/static/frontend/<Vendor>/<theme>
bin/magento setup:static-content:deploy -f --area frontend --theme <Vendor>/<theme> --no-parent

Done.

4
  • I am using Amasty Checkout Commented Oct 31, 2022 at 6:41
  • Hi @NicolaSmith I added the solution for Amasty Checkout module 10 days ago, did you check it? If this answer works as your expected, please mark it as accepted, it makes it easier for others with the same issue to find a verified answer. And click the upvote button for the answer in case you feel it is useful.
    – Tu Van
    Commented Nov 9, 2022 at 8:44
  • Hi @Tu Van , i accepted your solution, can you please also help me out with this magento.stackexchange.com/questions/361598/… Commented Nov 9, 2022 at 12:34
  • Great, that will help others who have the same issue to come here in the future. I've taken a look at the Invoice PDF issue, it requires time for development so I'm not able to give you the solution quickly, but I'll certainly add it to my queue.
    – Tu Van
    Commented Nov 9, 2022 at 13:30
0

First, you can hide it with CSS.

  • app/design/frontend/your theme vendor/theme/web/css/source/_extend.less
  • .shipping .new-address-popup { display: none }

Second, You can disable the codes

  • You have to copy the file from vendor/magento/module-checkout/view/frontend/web/template/shipping.html to your theme directory app/design/frontend/your theme vendor/theme/Magento_Checkout/web/template/shipping.html
  • Then you can find the below codes that related to "new address"
    <if args="!isFormInline">
        <div class="new-address-popup">
            <button type="button"
                    class="action action-show-popup"
                    click="showFormPopUp"
                    visible="!isNewAddressAdded()">
                <span translate="'New Address'"></span>
            </button>
        </div>
        <div id="opc-new-shipping-address"
             visible="isFormPopUpVisible()"
             render="shippingFormTemplate"></div>
    </if>

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