I've added "Address Information" on customer registration page & want to remove the mandatory field from the "City" and "Street Address" Field for that I've overrided register.phtml file on my custom theme.

& When I clicked on "Create An Account" button then getting below issue:-

"Delete operation is forbidden for current area"

While in the backend created account is showing but "Telephone" field(this is mandatory) value is missing.

When I log in using created account uname & pswd it's working.

So why this issue is coming?how can i resolve it?if you've any alternate solution you can share.

Please find the screenshots for the same:-

enter image description here

enter image description here

enter image description here

After debugging contrller **"Magento\Customer\Controller\Account\CreatePost" the problem is in below section:-**

enter image description here

Any update please?it's urgent so please help me to resolve this issue.

  • Here "city" is not mandatory so when i'm leaving this field(empty value) then getting this issue & when filling something then it's working fine. – wakar Ahamad Oct 25 '18 at 11:21
  • The problem is in (!$this->formKeyValidator->validate($this->getRequest())). it seems that need to work somwhere also. – wakar Ahamad Oct 25 '18 at 11:35
  • Street address and City are not default fields in Customer Account Create form, How you add them ? – amit_game Oct 26 '18 at 11:11
  • thanks for the reply,overrided customer_account_create.xml on my custom theme & added below code:- <referenceBlock name="customer_form_register"> <arguments> <argument name="show_address_fields" xsi:type="boolean">true</argument> </arguments> </referenceBlock> – wakar Ahamad Oct 26 '18 at 11:13
  • Even i tried to set static values like "NULL" on the controller "CreatePost.php" when "city" & "street address" fields are empty:- e.g- if(empty($_POST['city'])) {$_POST['city']=NULL} but it also doesn't work. – wakar Ahamad Oct 26 '18 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.