Categories

Featured templates

PrestaShop 1.6.x. How to remove contact form fields (i.e. Order Reference)

Sandra Kim August 18, 2016
Rating: 5.0/5. From 3 votes.
Please wait...

This tutorial provides an explanation on how to remove contact form fields in PrestaShop 1.6.x.

In order to remove contact form fields, you need to perform the following steps:

  1. Log into your Control Hosting Panel (cPanel) on a server.

  2. Locate the File Manager and go to your website folder (you can perform the next steps via your FTP as well).

  3. Navigate to the themes/themeXXX/ directory, and open the contact-form.tpl file (or download it in order to edit it on your computer).

    prestashop_how_to_remove_contact_form_fields_1
  4. For instance, let’s remove the Order reference field.

    prestashop_how_to_remove_contact_form_fields_2

    Use the search function in your code editor (Ctrl+F keys on your keyboard), and type order reference text as a search parameter.

    prestashop_how_to_remove_contact_form_fields_3

    You will find the order reference occurrence in this piece of code (on the line 80 approximately):

    	<label>{l s='Order reference'}</label>
    

    This code is wrapped with the {if}{/if} statement. You need to remove the entire {if}{/if} statement (lines 78-94 approximately):

    	{if (!isset($customerThread.id_order) || $customerThread.id_order > 0)}
    	<div class="form-group selector1">
    	<label>{l s='Order reference'}</label>
    	{if !isset($customerThread.id_order) && isset($is_logged) && $is_logged}
    	<select name="id_order" class="form-control">
    	<option value="0">{l s='-- Choose --'}</option>
    	{foreach from=$orderList item=order}
    	<option value="{$order.value|intval}"{if $order.selected|intval} selected="selected"{/if}>{$order.label|escape:'html':'UTF-8'}</option>
    	{/foreach}
    	</select>
    	{elseif !isset($customerThread.id_order) && empty($is_logged)}
    	<input class="form-control grey" type="text" name="id_order" id="id_order" value="{if isset($customerThread.id_order) && $customerThread.id_order|intval > 0}{$customerThread.id_order|intval}{else}{if isset($smarty.post.id_order) && !empty($smarty.post.id_order)}{$smarty.post.id_order|escape:'html':'UTF-8'}{/if}{/if}" />
    	{elseif $customerThread.id_order|intval > 0}
    	<input class="form-control grey" type="text" name="id_order" id="id_order" value="{if isset($customerThread.reference) && $customerThread.reference}{$customerThread.reference|escape:'html':'UTF-8'}{else}{$customerThread.id_order|intval}{/if}" readonly="readonly" />
    	{/if}
    	</div>
    	{/if}
    
    prestashop_how_to_remove_contact_form_fields_4
  5. Save your changes, re-upload the file back to your server, and refresh your website. The Order reference field has been removed from the contact form.

    prestashop_how_to_remove_contact_form_fields_5
  6. You can remove the rest of the fields that you do not need in the same way. For example, let’s review how to remove the Attach File field.

    Use your code editor search function, and type attach file text as a search parameter.

    prestashop_how_to_remove_contact_form_fields_6

    You will find the attach file occurrence in this piece of code (on the line 98 approximately):

    			<label for="fileUpload">{l s='Attach File'}</label>
    		

    This code is wrapped with the {if}{/if} statement as well. You need to remove the entire {if}{/if} statement (lines 96-102 approximately):

    			{if $fileupload == 1}
    			<p class="form-group">
    			<label for="fileUpload">{l s='Attach File'}</label>
    			<input type="hidden" name="MAX_FILE_SIZE" value="{if isset($max_upload_size) && $max_upload_size}{$max_upload_size|intval}{else}2000000{/if}" />
    			<input type="file" name="fileUpload" id="fileUpload" class="form-control" />
    			</p>
    			{/if}
    		
    prestashop_how_to_remove_contact_form_fields_7
  7. Save your changes, re-upload the file back to your server, and refresh your website. The Attach File field has been removed from the contact form too.

    prestashop_how_to_remove_contact_form_fields_8

Now you know how to remove contact form fields in PrestaShop 1.6.x.

Feel free to check the detailed video tutorial below:

PrestaShop 1.6.x. How to remove contact form fields (i.e. Order Reference)

We also have a collection of other Prestashop themes that may get you interested.

Best Prestashop Themes
This entry was posted in PrestaShop Tutorials and tagged contact form, fields, Prestashop, remove. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket