I have included the register.phtml file in another .phtml file using the following code:
<?php echo $this->getLayout()->createBlock("Magento\Customer\Block\Form\Register")->setTemplate("Magento_Customer::form/register.phtml")->toHtml(); ?>
This code is used to display the registration form as a popup. Additionally, I have created an customer_account_create.xml file to enable the display of address fields on the registration form. When I navigate to $baseUrl/customer/account/create/, the address fields are displayed correctly. However, when I open the popup that calls the register.phtml file, the address fields are not displayed.
The path where I have called the register.phtml file is: app/design/frontend/Smartwave/porto_child/Smartwave_Porto/templates/html/login.phtml.
I also tried using the following approach:
<?php $this->setShowAddressFields(true) ?>
But I encountered the following error: Error: Call to a member function getFrontendLabel() on null.