How to edit the contact form?

Hello, please could someone help me and let me know how I can edit the conact form? I wish to remove the telephone number or at least make it not a required field. 

Hi Captain,

navigate to Settings > Email templates look for Contact form and use the three dots press edit and you should see the plain text and HTML version in there.

1 Like

@Timmy_Clark schrieb:

Hi Captain,

navigate to Settings > Email templates look for Contact form and use the three dots press edit and you should see the plain text and HTML version in there.

Thank you for your reply Timmy. All I can see is the one below, but this looks more like the email that is emailed to me after a customer fills out the form, rather than editing the fields that the customer themsleves fills out. I am sure it is there somehwere, just I cant find exactly where (monkey covering eyes emooji)

Hello Captain,

Copy file platform/src/Storefront/Resources/views/storefront/element/cms-element-form/form-types/contact-form.html.twig to your plugin, then override it or replace with your code.

I wanted to remove the Salutation. 
But then the validation crashes. 
How can i easy change this? 

@KrielkipNL schrieb:

I wanted to remove the Salutation. 
But then the validation crashes. 
How can i easy change this? 

Same Problem here. Is there a solution?

Go to settings, then there is an option of email templates, there you can find the HTML form there. I hope this helps!

Hey,
Thanks for the answere.
Maby i should explain the problem a bit more:

So first i remove the phone-number from the contact-form.html.twig by commenting out the block:
 

{#       
 {% block cms_form_contact_input_phome %}
            {% sw_include '@Storefront/storefront/element/cms-element-form/form-components/cms-element-form-input.html.twig'
                with {
                fieldName: 'phone',
                required: true,
                additionalClass: 'col-md-6',
                label: 'account.personalPhoneLabel',
                placeholder: 'account.personalPhonePlaceholder'
            }
            %}
        {% endblock %} 
#}

After that i clear the cache. So my frontend take over the change (the phone number field is no longer visible).

After that i change the email-templete in the settings. I remove the phone-number part.
So now i want to use my contact-formular on the frontend. I fill in all the visible fields (the phone number is not visible) and click submit.
I get an errror message: “This value should not be empty”.

If i add the phone-number back to the form and fill out the field everthing works fine.

I guess there is a validation-script or something. This script wants an input for the phone-number but there is no phone-number so the script returns an error message.

What is the usal way to deal with that problem?

We need to remove the phone-number cause of data protection.

Thanks for your help!

 

You could try to replace the desired field with a hidden input field and theń manually fill it with a default value.
So the user doesnt see the input field and the validation wont fail.

As far i know, you cant change the validation easily yet.

e.g.:

So with Version 6.3.4.0 there is finally an easy way to deactivate the phone-number as requiered field:
In the Shopware-Backend Got to:

settings -> basic Information

and deactivate “set phone number as requiered field in contact formular”

1 Like

The trick with the hidden input field works for some of the required fields like „comment“, but not for the salutation. The salutation field expects to receive the UUID value that is associated with each salutation. You can check the http response in the network tab for the UUID values of a submitted form, and then include that in an hidden input field. However, this will only work as long as the UUID value does not change (local vs. production environment)

This is helpful to me. Thanks

Agree here we need to be able to easily disable/enable SW6 form elements. SW6 dev team has made progress but could be improve on

Under the Security and Privacy it should not be difficult to include the option to

  1. Enable/disable for each each field
  2. Enable / disable Required input

@SW6 Dev Team

Why did you stop at
Show „Accept all cookies“ button"
First name in contact forms required
Last name in contact forms required
Phone number in contact forms required

There are site that only require minimal information for a site contact form and for better user privacy. If a Site owner needs more detailed that info would be supplied at check out and should not be required for a simple contact form

I hope to see this implemented din the near future