212

Product support

Get help in the plugin support forum.

Categories

About the plugin

Plugin is used for simple creation of forms in the administrative interface and displaying them on the site pages.

This plugin is intended for developers.

For developers, it represents a ready-made backend for storing form configurations, processing them and delivering them. It also provides ready-made fragments for use as flexibly as possible in combat situations.

For users (customers), this plugin provides simple basic settings. For example, the user can change the form headers, field names, text on the button, comments, and the most important thing is to assign mail templates and configure additional sending functions.

The plugin does not provide a form design. Only the basic markup. The stylization of the form is on your shoulders. The plugin has a built-in form handler that supports all the functions from the backend.

The plugin has built-in integration with the SendPulse mailing service. Additionally , SendPulse integration with the Lovata.OrdersForShopaholic plugin is built in.

Many options for managing the handler. Choosing mail templates for forms.

Attention! Do not give customers full root access to the system, otherwise they may disrupt the plugin by making incorrect settings. The rights are prepared in the plugin. Create a new user and assign - Manager permission.

Getting forms

First, create a form and the necessary fields. After the form is created, it will be assigned a code. Throw the Forms component to the desired site pages or layout.

There are 2 ways to get a form in total.

1. By ID

{% set form = Forms.getByID(1) %}

I do not recommend this method, since when deleting the form you will have to replace the call in the code.

2. By code

{% set form = Forms.getByCode('code') %}

This method is preferable, because you can always assign a code to the form. (Developer rights are required)

Render on the page

The plugin has ready-made fragments for use. They are as unified as possible and should be suitable for most sites.

1. You can print the entire form by calling the form fragment

{% set form = Forms.getByCode('code') %}

{% partial 'Forms::form' id='contact-form' form=form %}

If necessary, you can pass additional data to the form.

{% partial 'Forms::form' id='contact-form' form=form additional_data=[{key: value}, {key: value}] %}

They will be printed in hidden fields.

Important! It is necessary to pass the mandatory parameter 'id= 'html_id" it is necessary to avoid conflicts if several identical forms are called on the same page. You can pass any string that matches the name of the html identifier.

2. You can only print the fields

{% partial 'Forms::fields' id='contact-form' form=form %}

Sometimes such a call is necessary if your form requires increased customization. With such a call, you need to independently implement events and pass basic data in the handler, such as`form_id'.

You can see how the fragments are arranged and change them for yourself by creating copies in /themes/theme/partitions.

Printing fields individually

This plugin can be used as a constructor. For example, you can make an order form for Shopaholic. Then the customer will be able to change the data of the fields.

To do this, you can print only the fields. So that you can collect everything that your heart desires.

The plugin has ready-made fragments for printing all available field types. And additionally, the Form model has a method for getting a field by its name. Here is an example:

{% set form = Forms.getByCode('code') %}

{% partial 'Forms::text' id='contact-form' form=form.getFieldByName('email') %}

This is the way you can print a field with the email name without printing the entire form.

1.0.4

Fixed a bug with the absence of OrdersFormShopaholic

Oct 13, 2021

1.0.3

Added English localization

Oct 13, 2021

1.0.2

Added integration with SendPulse

Oct 13, 2021

1.0.1

Initializing the plugin

Oct 13, 2021