Jump to content

[SOLVED] PS 1.7.5 B2B - How to remove fields form registration form


mausbaus

Recommended Posts

Hello Everybody,

I've been spending the last hours looking and not finding a way to remove some fields from the registration form when B2B is enabled. 

I don't want to disable the B2B module, I just need to remove the company and vat fields because I am using a custom fields module and I want to separate the "Personal Info" from the "Company Info". If the B2B is disabled, yes, the locations/country address format applies, but the B2B module adds the fields have no idea where to delete what:)

The forums are filled with similar questions but no answers. Still, I hope a knowledgeable person here can point me in the right direction without trying to sell me a module or custom work. 

Edited by mausbaus (see edit history)
Link to comment
Share on other sites

Solution:

Go to templates->customer->_partials->customer_form.tpl where you have 

<section>
    {block "form_fields"}
      {foreach from=$formFields item="field"}

      {/foreach}
      {$hook_create_account_form nofilter}
    {/block}
  </section>

and add

{if $field.name=='company'}{continue}{/if}
{if $field.name=='siret'}{continue}{/if}

to become

  <section>
    {block "form_fields"}
      {foreach from=$formFields item="field"}
		{if $field.name=='company'}{continue}{/if}
		{if $field.name=='siret'}{continue}{/if}
      {/foreach}
      {$hook_create_account_form nofilter}
    {/block}
  </section>

This will skip the 2 rows in the form. 

Same for Gender. If you want your form not to show it, add

      {if $field.name=='id_gender'}{continue}{/if}

as the first {if}

Link to comment
Share on other sites

  • 1 month later...

Hi mate, this is exactly what I need and have been searching for the past few hours!

Where did you find the values to choose from for $field.name?

Because I'm also interested in getting rid off Social Title, Date of Birth and Partner offers.

Cheers,

 

Link to comment
Share on other sites

  • 1 month later...

Hello, sorry for the late reply...

To get rid of Date of Birth and Partner Offers, go to Shop Parameters > Customer Settings  and disable both from that page. 

To get rid of the social title, go to templates->customer->_partials->customer_form.tpl where you have and right after 

{foreach from=$formFields item="field"}

add

{if $field.name=='id_gender'}{continue}{/if}
Link to comment
Share on other sites

  • 1 month later...

It works by having this

<form action="{block name='customer_form_actionurl'}{$action}{/block}" id="customer-form" class="js-customer-form" method="post">
  <section>
    {block "form_fields"}
      {foreach from=$formFields item="field"}
	 		 {if $field['name'] == 'company'} {continue}{/if}
     			 {if $field['name'] == 'siret'} {continue}{/if}
        {block "form_field"}
          {form_field field=$field}
        {/block}
      {/foreach}
      {$hook_create_account_form nofilter}
    {/block}
  </section>

 

  • Like 2
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

if you use Prestashop 1.7.6.1, you will need to do it the following way:

Affected Files: templates/YOURTEMPLATE/customer/_partials/customer-form.tpl

Original:

    {block "form_fields"}
      {foreach from=$formFields item="field"}
        {block "form_field"}
          {form_field field=$field}
        {/block}
      {/foreach}
      {$hook_create_account_form nofilter}
    {/block}

Customized:

    {block "form_fields"}
    {foreach from=$formFields item="field"}
    {if $field.name=='siret' || $field['name'] == 'company'}
    {continue}
    {else}
    {block "form_field"}
      {form_field field=$field}
    {/block}
    {/if}
    {/foreach}
      {$hook_create_account_form nofilter}
    {/block} 

I hope it does help you guys.

Edited by solidbeat (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 years later...

in my case i have to update 

templates/YOURTEMPLATE/customer/_partials/address-form.tpl

 

replace 

            {block name="address_form_fields"}
            <section class="form-fields">
                {block name='form_fields'}
                {foreach from=$formFields item="field"}
                 {block name='form_field'}
                {form_field field=$field}
                {/block}
                {/foreach}
                {/block}
            </section>
            {/block}

with 

               {block name="address_form_fields"}
            <section class="form-fields">
                {block name='form_fields'}
                {foreach from=$formFields item="field"}
                {if $field.name=='siret' || $field['name'] == 'company' || $field['name'] == 'address2' || $field['name'] == 'vat_number'   }
                {continue}
                {else}
                {block name='form_field'}
                {form_field field=$field}
                {/block}
                {/if}
                {/foreach}
                {/block}
            </section>
            {/block}

 

for removing VAT, company and address2

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...