Jump to content

How to remove some fileds on contact us form?


wojwen

Recommended Posts

In the default contact us form there are certain fileds like order number or add file option that I don't need at all and I would like t remove them. The problem is that I can't find any module that is resposinble for that. Do I have to edit tpl file or have I missed something?

Link to comment
Share on other sites

Hi!

Maybe this helps removing that add file option:

You can find "Allow file uploading" from

Customer --> customer service

Fields remove I would also like to no how it is done.

I want to get one field removed but I haven't find any solution.

  • Like 1
Link to comment
Share on other sites

The implementation is different for PrestaShop 1.6x or lower and PrestaShop 1.7x

 

For PrestaShop 1.6x or lower, you can find following files for this page

/controllers/front/ContactController.php

/themes/default-bootstrap/contact-form.tpl

 

For PrestaShop 1.7x it is implemented in following module

/modules/ps_contactinfo/ps_contactinfo.php

/modules/ps_contactinfo/ps_contactinfo.tpl

/modules/ps_contactinfo/ps_contactinfo-rich.tpl

 

 

To remove the field, you will need to remove related files in themes files (.tpl).

But you may also need to modify related controller file or module file if it is required fields.

  • Like 1
Link to comment
Share on other sites

if you want to get detailed instructions, you better give detailed request first.

I am not sure which field you wanted to be removed.

 

If you want to remove file upload field, you can try to remove following lines

 

{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}
Link to comment
Share on other sites

Sorry. Maybe this is more detailed.

I am tyring to remove Order reference field:

post-1357462-0-75810300-1483978870_thumb.png

 

What file I should edit?

I remove from the contact-form.tpl the next lines to test if the attach file disappears but it didn't help:
                    {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}

 

 

After that I erase a lot more just to test if the order refererence field disappears or something else would.

In catalog mode oreder reference field is not visible and probably this part from contact-form.tpl has something to do whit that? Probably I am in a wrong file?

But anyway I removed this part and nothing disappeared:

</p>
                    {if !$PS_CATALOG_MODE}
                        {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}
                        {if isset($is_logged) && $is_logged}
                            <div class="form-group selector1">
                                <label class="unvisible">{l s='Product'}</label>
                                {if !isset($customerThread.id_product)}
                                    {foreach from=$orderedProductList key=id_order item=products name=products}
                                        <select name="id_product" id="{$id_order}_order_products" class="unvisible product_select form-control"{if !$smarty.foreach.products.first} style="display:none;"{/if}{if !$smarty.foreach.products.first} disabled="disabled"{/if}>
                                            <option value="0">{l s='-- Choose --'}</option>
                                            {foreach from=$products item=product}
                                                <option value="{$product.value|intval}">{$product.label|escape:'html':'UTF-8'}</option>
                                            {/foreach}
                                        </select>
                                    {/foreach}
                                {elseif $customerThread.id_product > 0}
                                    <input  type="hidden" name="id_product" id="id_product" value="{$customerThread.id_product|intval}" readonly="readonly" />
                                {/if}
                            </div>
                        {/if}
                    {/if}
                    {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}

Link to comment
Share on other sites

  • 1 year later...

Hi,

i am newbie here. i'm having a similar problem as i want to remove the attach file section however, after i did some alteration in the source code and delete the attach file's line, the attach file section still appeared in my contact form. how do i do that?. 

please somebody help me

Thank you

 

 

Link to comment
Share on other sites

  • 1 year later...

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...