2017-07-04 25 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