Table of Contents |
---|
Context
Store app properties are used to customize the level of information displayed on screen for a given entity. OneStock's basic display is like this:
...
You can find this configuration in the configuration -> store_app -> pages
section of your admin backoffice (https://admin.onestock-retail.com/cXXX/config/store_app/pages).
Advanced customization
Tip |
---|
To view the default properties, use the test command |
Multi parcel
In the case of pages that support multi-packaging (bag and pack), there is an entity called multi_order
, which corresponds to the one used when the store app is configured for multi-packaging (options.create_multi_parcels key
).
Popins
The information level of the various popins can also be configured.
Properties Formatting
Object properties often need to be formatted for aesthetic reasons.
It is possible to use one or more formatters with the following syntax property|formatter:option|formatter|formatter
.
Tip |
---|
Examples:
|
Parenthesis
A parenthesis syntax is available for the most complex expressions.
Properties that are nested within parentheses will be evaluated first. For example, the property parcels|forcount:line_item_ids|concatraw: / |concatraw: (line_items|length)
will display 1 / 2.
In the absence of parentheses, formatters are applied from left to right.
All formatters availables
Name | Description | Option | Example → Render | ||||||
---|---|---|---|---|---|---|---|---|---|
| Retrieves the element of an array with index. | Element index |
| ||||||
| Replace all letters with lower case, except the first, which is upper case. |
| |||||||
| Concatenates another property, without spaces. | Property to concatenate |
| ||||||
| Concatenates a string. | Defined string |
| ||||||
| Formats a number into a currency, with a symbol defined in another property. | Property containing the currency |
| ||||||
| Formats a number into a currency, with a symbol defined in the expression. | The currency to use |
| ||||||
| Format a date range. | Property corresponding to end date |
| ||||||
| Divides a value of a property by an another. | Divisor property |
| ||||||
| Returns a date in the color sent if expired. It is possible to pass a relative parameter (seconds to be subtracted from the expiry date). | The warning value to be subtracted from the current date for the calculation (in seconds) The color to be set if the date has expired. The value to be returned. |
| ||||||
| Scans an array and keeps the elements of this array whose property is worth one of the values provided. | Comma-separated list of values |
| ||||||
| Scans an array and counts the number of elements in the array whose property has one of the provided values. | Comma-separated list of values |
| ||||||
| Scans an array and counts the size of each property in the array. | Property |
| ||||||
| Scans an array and returns the element with the lowest index in the array defined in option . If nothing matches, does nothing. | Comma-separated list of values |
| ||||||
| Calculates the total quantity of indexes in the supplied index ranges. |
| |||||||
| Returns the length attribute of an array or string. |
| |||||||
| Formats the result as a link. | Property |
| ||||||
| Formats the result as a blank link. | Property |
| ||||||
| Replace all letters with lowercase letters. |
| |||||||
| Format a timestamp using momentjs. | Date format |
| ||||||
| Multiplies two values. | Can take optional features or constants. You can limit the number of decimal places by adding a second argument separated by a comma. By default, results are limited to 2 digits after the decimal point. |
| ||||||
| Concatenates another property on the left. | Property |
| ||||||
| Concatenates a string on the left. | Defined string |
| ||||||
| Replaces the result with a string defined. | Defined string |
| ||||||
| Scans an array and sum the given property in the array. | Property |
| ||||||
| Displays tracking code if available, translates key passed in parameter otherwise. | Key to translate |
| ||||||
| Translates the result (if the translation key exists). |
| |||||||
| Takes a number as input and calls a translation with pluralization. | Key to translate |
| ||||||
| Calls a translation with pluralization on the input. Displays nothing if !input is false in the javascript sense. | Key to translate |
with line_items = [] : | ||||||
| Scans an array and counts the number of elements whose property is not one of the provided values. | Comma-separated list of values |
| ||||||
| Replace all letters with capital letters. |
| |||||||
| Takes a date as input and returns the difference from now in the site's lang. |
|