Jump to content
mausbaus

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

Recommended Posts

Posted (edited)

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)

Share this post


Link to post
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}

Share this post


Link to post
Share on other sites

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,

 

Share this post


Link to post
Share on other sites

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}

Share this post


Link to post
Share on other sites

As an update, what I wrote above it appears not to be working in 1.7.6 anymore.

Share this post


Link to post
Share on other sites

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>

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More