captaincaptain MemberComments: 2 Received thanks: 0 Member since: July 5

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. 

Answers

  • Timmy_ClarkTimmy_Clark MemberComments: 10 Received thanks: 5 edited July 6 Member since: March 5

    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.

    Thanked by 1James_hill43
  • captaincaptain MemberComments: 2 Received thanks: 0 Member since: July 5

    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)

    image

  • Ania_ZavodianAnia_Zavodian MemberComments: 1 Received thanks: 0 Member since: July 14

    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.

  • KrielkipNLKrielkipNL MemberComments: 1 Received thanks: 0 edited July 31 Member since: July 31

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

  • James_hill43James_hill43 MemberComments: 8 Received thanks: 0 Member since: August 10

    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.

    thanks man this helped me as well. thanks alot..

  • paracelparacel MemberComments: 3 Received thanks: 0 Member since: August 27

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

    Same Problem here. Is there a solution?

  • shopware1shopware1 MemberComments: 10 Received thanks: 0 Member since: November 4

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

  • paracelparacel MemberComments: 3 Received thanks: 0 Member since: August 27

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

    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!


     

  • Marcus SaldenMarcus Salden MemberComments: 29 Received thanks: 10 edited November 6 Member since: April 2013

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

Sign In or Register to comment.