Thanks to visit codestin.com
Credit goes to storefront.developers.shoper.pl

Skip to content

Number

Number element is an input with number type.

number

Options

prefix

string Optional parameter.

postfix

string Optional parameter.

placeholder

string Optional parameter. Placeholder in input.

JSON
{
"options":
    {
      "prefix" : "-",
      "postfix" : "%",
      "placeholder" : "discount"
    }
}

Build-in Validators

Element have build-in one validator: float.

Available Validators

Element has available validators:

Relations Support

Element supports relations between elements.

Configuration output schema

schema
{
  "<element_type>" : "number",
  "<element_name>" : string,
  "<element_label>" : string,
  "<element_labelDescription>" : string,
  "<element_isRequired>" : bool,
  "<element_isHidden>" : bool,
  "<element_defaultValue>" : number,
  "<element_options>" : {
    "<element_option_prefix>" : string,
    "<element_option_postfix>" : string,
    "<element_option_placeholder>" : string
  },
  "<element_validators>" : []
}
example
{
  "type" : "number",
  "name" : "discount",
  "label" : "Discount on sign to newsletter",
  "labelDescription" : "When user sign to newsletter will get X percentage discount.",
  "isRequired" : false,
  "isHidden" : false,
  "defaultValue" : 2,
  "validators": [
    { "type" : "positiveNumber" },
    { "type" : "int" },
    { "type" : "lessEqThan", "options" : { "max" : 25 } }
  ],
  "options": {
    "prefix" : "-",
    "postfix" : "%",
    "placeholder" : "discount"
  }
}