1

I want to disable 'add new address' button from customer account address book and customer account section with checking if my custom module is - enable/disable.

file name is : vendor\magento\module-customer\view\frontend\templates\address\book.phtml

how can I override it and disable the button and edit/delete address link also?

Thanks

asked Dec 12, 2018 at 10:16

2 Answers 2

0

You can copy book.phtml file in your current theme on below path and comment the required code.

app/design/frontend/DESIGN_PACKAGE/THEME_NAME/Magento_Customer/templates/address/book.phtml
answered Dec 12, 2018 at 10:32
1
  • I want this thing with module. not with theme. Commented Dec 12, 2018 at 12:02
0

You can override the layout file in your module.

from:

vendor\magento\module-customer\view\layout\customer_address_index.xml

To

Name\Module\view\frontend\layout\customer_address_index.xml

then override phtml file in your module from

vendor\magento\module-customer\view\frontend\templates\address\book.phtml

To

Name\Module\view\frontend\templates\address\book.phtml

and do the needful changes.

Thanks.

Ashish Viradiya
1,5802 gold badges20 silver badges39 bronze badges
answered Dec 13, 2018 at 14:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.