RuffRuff Order Limits

Using Variables

This article explains the variables you can use in the product message and alert message, how to insert them, and notes.

Inserting variables into the product message and alert message lets you dynamically display the values set in a rule. You do not need to rewrite the message even if you change the restriction.

Variables are inserted into the message in the format `{{variable name}}`. Typing them by hand or inserting them with a button works the same way.

(1) Select the product message input field

On the rule's edit screen, select the product message input field.

(2) Select "Insert variable" (the code icon) in the toolbar

Select the variable you want to insert, and it will be added at the cursor position.

(1) Select the alert message input field

On the rule's edit screen, select the alert message input field.

(2) Select the variable button above the input field

Select the variable you want to insert, and it will be added at the cursor position.

Variable

Description

Example

Available in

{{minQuantity}}

Minimum quantity

3

Product message and alert message

{{maxQuantity}}

Maximum quantity

10

Product message and alert message

{{increment}}

Increment

5

Product message and alert message

Example: Please purchase {{minQuantity}} or more and {{maxQuantity}} or less. → Please purchase 3 or more and 10 or less.

Variable

Description

Example

Available in

{{limit}}

Maximum quantity

5

Product message and alert message

{{purchased}}

Purchased count

3

Messages for signed-in customers only

{{remaining}}

Remaining allowance

2

Messages for signed-in customers only

{{productTitle}}

Product title

T-shirt

Product message only

Example: You can purchase {{remaining}} more. → You can purchase 2 more.

Which variables are available differs by field. In the fields for customers who are not logged in, only {{limit}} and {{productTitle}} are available. For the full list per field, see Cumulative Quantity Rules: Settings.

Variable

Description

Example

Available in

{{minPrice}}

Minimum price (number only)

1000

Product message and alert message

{{maxPrice}}

Maximum price (number only)

50000

Product message and alert message

Example: You can purchase from {{minPrice}} or more. → You can purchase from 1000 or more.

Note: Price variables are replaced directly with the number set in your store currency. Thousands separators and currency symbols are not added, and the value is not converted even if you sell in local currency. Include the currency symbol in the message itself.

Variable

Description

Example

Available in

{{limit}}

Maximum amount (number only)

10000

Product message and alert message

{{purchased}}

Purchased amount (number only)

4000

Messages for signed-in customers only

{{remaining}}

Remaining allowance (number only)

6000

Messages for signed-in customers only

{{productTitle}}

Product title

T-shirt

Product message only

Example: You can purchase {{remaining}} more. → You can purchase 6000 more.

Note: In the product message, the amount variables of a cumulative price rule are replaced with the store currency amount as a plain number and are not converted to the storefront's display currency. In the checkout messages, they are replaced with the amount converted to the currency the customer pays in. Neither adds thousands separators or a currency symbol, so write the unit in the message itself.

Which variables are available differs by field. In the fields for customers who are not logged in, only {{limit}} and {{productTitle}} are available. For the full list per field, see Cumulative Price Rules: Settings.

Variable

Description

Example

Available in

{{minWeight}}

Minimum weight (with unit)

500g

Product message and alert message

{{maxWeight}}

Maximum weight (with unit)

2kg

Product message and alert message

{{currentWeight}}

Current weight totaled by applicability (with unit)

1.5kg

Alert message only

Example: You can purchase this product up to {{maxWeight}}. → You can purchase this product up to 2kg.

You cannot use variables in the messages for bundle rules, customer rules, payment rules, or delivery rules.

The messages for quantity limits, price limits, and weight limits by product are managed in "Settings" for each feature, and you can use dedicated variables such as {{itemName}} and {{productTitle}}. For the variables you can use, see the settings article for each feature.

  • Variables are enclosed in {{ and }}.

  • Variable names are case-sensitive. {{maxQuantity}} is valid, and {{MaxQuantity}} is not.

  • If the corresponding value is not set in the rule (for example, using {{maxQuantity}} in a rule where maximum quantity is not set), the variable is replaced with an empty string.

  • If you enter a variable name that does not exist, the text you entered is displayed as is.

  • In cumulative quantity rules and cumulative price rules, typing {{purchased}} or {{remaining}} into a message for customers who are not logged in leaves the text as you entered it. The purchased and remaining values are only shown to customers who can be identified.