0

I want to add phone number to the customer creation page, since on of our users want's to contact people when they register to their webpage.

I did follow this guide (https://store.magenest.com/blog/add-custom-field-to-registration-page-magento-2/) But as you can see (http://lommel.no/customer/account/create/) no phone number was added.

I did upgrade - dicompile - content:deploy - reindex and cleared cache. But nothing.

is there something wrong with the guide?

Magento version: 2.3 Theme: Porto

Any help is appreciated

12
  • 1
    Can you plz show your code what you have to Do ? paste all file particularly customer_account_create.xml – Hassan Ali Shahzad Oct 31 '20 at 17:13
  • Cusotomer_account_create.xml <page xmlns:xsi="w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="form.additional.info"> <block class="Magento\Framework\View\Element\Template" name="phone_number" template="Magenest_CustomerAttribute::extra_field.phtml"/> </referenceContainer> </body> </page> – Jan-petter Havna Oct 31 '20 at 17:35
  • 1
    HAVE YOU FACE ANY ERROR DURING php bin/magento setup:upgrade – Hassan Ali Shahzad Oct 31 '20 at 17:55
  • Not at all, no errors what's so ever. That's why is find this so weird – Jan-petter Havna Oct 31 '20 at 18:00
  • 1
    If no issue in your customer_account_create.xml layout file it should show at least field in the Form, either it work or not. – Hassan Ali Shahzad Oct 31 '20 at 18:15
1

Your Modules Directory structure will be:

enter image description here

replace your Magenest/CustomerAttribute/view/frontend/layout/customer_account_create.xml with the following

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="form.additional.info">
        <block class="Magento\Framework\View\Element\Template" name="additional_info_customer_phone_number" template="Magenest_CustomerAttribute::extra_field.phtml"/>
    </referenceContainer>
</body>
</page>
5

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.