Options

Options are special form fields which a customer can interact with. They are used to make a product customizable by the customer, give him an opportunity to add personalized information and calculate the price based on the information received through the options.

Option Types

Text Input

Probably most commonly used type of Option :) Adds a possibility to use simple text input, though with an opportunity to make it numeric field or decimal field or even use conditional validation logic (at the moment, this functionality is enabled for this Option only).

Text Area

Adds a simple text area field.

Select

Adds a dropdown - a possibility to choose only one value.

Radio Inputs Free | Pro

Adds radio input fields - a possibility to choose only one value.

Checkbox Inputs Pro

Adds checkboxes - a possibility to select more than one value.

Date Picker Pro

Adds nice JS based date picker with two modes: single date and dates range.

File Upload Pro

Adds nice JS based AJAX file upload field.

Dynamic Notice Pro

Adds a possibility to display some data like regular and non option variables values as well as perform virtually any operations with these data by using JS code.

Range Slider Pro

Adds nice JS based range slider. Can be of two types: single and double.

Matrix Pro

Adds a matrix-like table with a possibility to choose any value from it. The info about chosen column name, row name and the value in the intersection of the column and the row will be available in the cart item meta.

Option Settings Synchronization. Connect and Duplicate Functionalities

Before proceeding, please, read more about two layers of storing the data used in the builder (option settings and the builder content)

Sync State

Every option has a state, it can be either 'synced' or 'not synced'. Option's state shows whether the current instance of Option is activated, i.e., actually works like a form field with its own name, or not.

⚠️ Not synced Option instances are just dummy copies. They do not work as form fields. They cannot be used neither in price calculation nor in fields conditional logic. They must be synced (activated) prior using as Options.

These are the ways to activate Option:

  1. Save option's settings with a unique slug name to DB.

  2. Choose "Connect" in Sync setting, click on the blue arrow icon in order to fetch Options of the same type available in the DB, click on "Submit" button (it will appear next to the select field).

First method is most suitable for creating completely new Option.

The second method is most suitable for re-using already created Option.

Why all this sync stuff is ever needed?

There a couple of reasons for that:

  • Syncing basically means the process of creation of an Option object in DB (custom post type object in terms of WordPress).

  • To be able to keep a "master" copy of Option in DB and a bit different copies-instances of the Option in the products.

  • To be able to easily re-use Options in different products.

  • To be able to manage price-related settings of all the Option instances of the site in one place, instead of editing every instance one by one (this is future feature, it is not possible at the moment as "Options Manager" is not created yet).

The last question you may have is "Why I need Unsync button at all?". As you may already guessed, this button actually detaches an Option's instance (make it unsynchronized) from its "master" copy stored in DB. It may happen that you need to completely new Option based on the existing synced instance. Then you have to unsync this instance first, then you can add a unique slug and save to DB. ⚠️ Without detaching Option's instance, saving its settings with a new slug to DB will lead to overwriting connected "master" copy of the Option!

Last updated