Forms

Article Version

5.5.0 or newer

Table of contents

Introduction

The form generator is the perfect module-based system for creating personalized contact, support and service forms for the frontend. In the Shopware backend, forms can be easily customized to fit your personal needs. Shopware will then generate links to allow a simple integration into the frontend.

All forms will be automatically displayed using the style of your active template.

All forms can be combined with the Ticket System. You will be able to handle all requests within the Shopware backend without using any external email programs. Your advantages:

  • The form builder creates an arbitrary number of input fields for the frontend, as specified by the shop owner.
  • Input fields can be marked as either required or optional fields, including individual error messages if required fields were not filled in properly.
  • Drop down menus, checkboxes or radio buttons can be created in addition to plain text fields.
  • Each created form can be sent to a personalized email address, e.g. depending on the responsibilities of employees.
  • Forms will appear as separate HTML pages using the style of your online store.
  • Complaint handling can be completely integrated into Shopware (using either email or ticket system)

Overview

Overview of all forms

  • delete ( 1 )
  • edit ( 2 )
  • duplicate ( 3 )

Creating and editing a form

  • Name: Variables can be included in the email template by using the value from the name field, e.g. for integrating the comment field, use {sVars.comment}. If a row should contain 2 fields, e.g. postal code and city, the entries must be separated by a semicolon (e.g., zipcode;city). Spaces and special characters (e.g., ä,ö,ü,ß) are not allowed.
  • Description: This entry will be displayed in front of each input field in the frontend.
  • Type: Choose between input field, two input fields, radio-buttons, select box, textbox, checkbox and email. If the type eMail is used, the form will perform a check if the email address is valid.
  • View: Here you can set the mode of the fields: Normal, zip code & city, street & no. selectable
  • Options: Specified values displayed in selection boxes, check boxes and radio buttons. Multiple choices are only possible using selection boxes. They must be separated with semicolons. Otherwise, colons are used to separate single choices.
  • Comment: This field is being displayed as description in the frontend.
  • Error message: This message is displayed in the event of an error (optional).
  • Required: This specifies whether or not the field must be filled out.
  • Earth symbol: Using the Earth symbol you can translate your form for your language- and subshops.

Form master data

Here you can enter a Name (1) for the form. Additionally, the link of the form will be displayed underneath. To implement the form, go to Content/Shop pages in the backend and enter the URL of your form. As an example, you can use the existing contact form. The link is built as follows: shopware.php?sViewport=ticket&sFid=5 (5 being the form ID)

  • The field eMail (2) defines where all emails will be sent to. If you use the ticket system, all requests will be stored there directly.
  • The Subject (3) defines the subject for the eMail.
  • The field email-Template(4) defines the content of the email. Here you will be able to specify the previously defined fields on the form as variables. To implement them, use the 'Name' field as shown: {sVars.Name}
  • In the form header (5) you will be able to set a headline for the form
  • Form-confirmation (6) defines the text being displayed after the form has been sent.
  • Translations (7): Click the little globe symbol to add a translation to a specific field.

 

Limit to shops(1) Additionally, you can limit the form to a specified shop. If you leave this blank, the form will be available in all shops.

meta data (2). Here you can set your own meta data. The fields are as follows:

  • meta title
  • meta keywords
  • meta description

Tips & Tricks

Force eMail despite Ticket System

Sometimes you want to send forms using email despite using the ticket system. To force emails, simply add the following parameter to the link: shopware.php?sViewport=ticket&sFid=5&forceMail=1

If you are using SSL

If your shop is using SSL, your forms should be using it as well. Most of the form will be fetched in HTTPS but note that the included captcha in your template may be fetched using the HTTP port. This will most likely lead to errors in the browser console (mixed content on secure site).

To avoid this, edit your template as follows:

For the captcha, open the template file /templates/_default/frontend/forms/elements.tpl and find the following entry:


 
<img src="{url controller='captcha' rand=$rand}" alt="" />
 

Replace that entry with the entry below:


 
<img src="{url controller='captcha' rand=$rand forceSecure}" alt="" />
 

Now the captcha will now be fetched using HTTPS.

Checkbox Example

In some cases, you will want to include a mandatory checkbox to send forms. The following steps will teach you how to do so:

Create a checkbox in your form as follows:

Optionally, a confirmation of the value can be sent to your email address:

The form will now require the customer to tick the required checkbox before sending it:

Different inquiry forms for subshops and language shops

When you use different subshops the "Do you have any questions concernig this product?" link in the article detail page always refer to the same form. How can you use different forms for different sub shops?

Copy the form

In backend you find the created forms in "Content -> Forms". There you find the Inquiry form with ID 21 which is used for the english form (Anfrage Formular with ID 16 is for the german form). On the right side there is an icon to duplicate the form.

You find the duplicated form at the bottom of the page (Copy of Inquiry form). Open the form and change the fields and text. Please note the ID of the form which you can find in the link under the name. In this example it's the ID 25.

Now we have to associate it to the right subshop.

Associate the form to the subshop

Open in backend in "Settings -> Basic settings -> Frontend" the menu entry "Shopping Cart / item details". There you find an option called Request form ID. With the sub shop tabs you can now define the ID's for the different shops. Finally save the settings.

Clear the shop cache and after that the associated form will be shown in the frontend.