mausbaus Posted March 28, 2019 Share Posted March 28, 2019 (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 March 29, 2019 by mausbaus (see edit history) Link to comment Share on other sites More sharing options...
mausbaus Posted March 29, 2019 Author Share Posted March 29, 2019 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 More sharing options...
TrekkaEdev Posted May 24, 2019 Share Posted May 24, 2019 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 More sharing options...
mausbaus Posted July 1, 2019 Author Share Posted July 1, 2019 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 More sharing options...
mausbaus Posted August 14, 2019 Author Share Posted August 14, 2019 As an update, what I wrote above it appears not to be working in 1.7.6 anymore. Link to comment Share on other sites More sharing options...
mausbaus Posted August 14, 2019 Author Share Posted August 14, 2019 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> 2 Link to comment Share on other sites More sharing options...
The Acacia Villas Posted August 14, 2019 Share Posted August 14, 2019 what I wrote above it appears not to be working in 1.7.6 anymore. Link to comment Share on other sites More sharing options...
madmaxx Posted October 24, 2019 Share Posted October 24, 2019 Hi sombody can update this for 1.7.6.1 Link to comment Share on other sites More sharing options...
solidbeat Posted November 8, 2019 Share Posted November 8, 2019 (edited) 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 November 8, 2019 by solidbeat (see edit history) 1 Link to comment Share on other sites More sharing options...
giasemis Posted January 24, 2022 Share Posted January 24, 2022 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 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now