2017-07-04 26 views
0

我已经使用MagePlaza社交登录模块,并尝试添加一个字段的手机,但不知何故什么都没有弹出。我的模板在注册页面上显示,但不在注册弹出窗口中显示。下面是我的布局代码: - 在default.xml中Magento 2添加属性到客户注册表单不起作用

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> 
<body> 
    !-- Fix Porto Popup login --> 
    <referenceBlock name="form.additional.info"> 
     <block class="W3solver\Phone\Block\Customer" template="W3solver_Phone::Customer.phtml" name="customer_form_user_attributes" cacheable="false"> 
      <action method="setFormCode"> 
       <argument name="code" xsi:type="string">customer_account_edit</argument> 
      </action> 
      <action method="setEntityModelClass"> 
       <argument name="code" xsi:type="string">Magento\Customer\Model\Customer</argument> 
      </action> 
     </block> 
    </referenceBlock> 
</body> 

如果有人可以帮助那么这将是非常感激。由于

回答

0

请尝试form_additional_info而不是form.additional.info因为在扩展/Mageplaza/SocialLogin/view/frontend/templates/popup/form/create.phtml这里线#157 <?php echo $block->getChildHtml('form_additional_info'); ?>这个代码可以..所以可能是其作品..

UPDATE

<block class="W3solver\Phone\Block\Customer" template="W3solver_Phone::Customer.phtml" name="form.additional.info" as="form.additional.info" cacheable="false"> 
     <action method="setFormCode"> 
      <argument name="code" xsi:type="string">customer_account_edit</argument> 
     </action> 
     <action method="setEntityModelClass"> 
      <argument name="code" xsi:type="string">Magento\Customer\Model\Customer</argument> 
     </action> 
    </block> 

添加此在default.xml文件中的“popup.create”块内更新布局..

+0

我已经尝试了两种方法。 – arushi

+0

你可以发布你的“Customer.phtml”文件代码吗? –

+0

你想让我更改mazeplaza模块吗?我的default.xml文件路径是W3solver \ Phone \ view \ frontend \ layout \ default.xml – arushi