3

i want to override block phtml file for customer address edit, first i created the customer_account_edit.xml at Namespace/Moduke/view/frontend/layout/ :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
      <referenceBlock name="customer_edit">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Namespace_Module::customer_address_edit.phtml</argument>
        </action>
      </referenceBlock>
    </body>
</page>

then i created the phtml file located at Namespace/Module/view/frontend/templates/customer_address_edit.phtml

but it still load the vendor phtml file, not the one i made

2

You can also used below code

<referenceContainer name="content">
    <block class="Magento\Customer\Block\Form\Edit" name="customer_edit" template="Namespace_Module::customer_address_edit.phtml" cacheable="false" >
        <container name="form.additional.info" as="form_additional_info"/>
    </block>
</referenceContainer>
| improve this answer | |
  • it isnot working – simple guy Aug 8 '17 at 7:02
0

Try below code :

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <referenceBlock name="customer_edit">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Namespace_Modulename::address/edit.phtml</argument>
                </action>
            </referenceBlock>
         </referenceContainer>
    </body>
</page>

After that clear the cache by running command php bin/magento cache:clean

| improve this answer | |

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.