Conditional sub-layouts

Centara can have conditional sub-layouts.

Idea with conditional sub-layouts is that you have one default sub-layout which is normally shown. And you have one or more conditions which will replace the default sub-layout when their condition is true.

If more than one condition is true then first one wins.

Configuration

To set up conditional layout

Go in the settings for a layout which you wish to have sub-layout on.

Examples:

The following condition checks if there is customer set and if the customer is in the customer group which has the key VIP_Customers.

customer && customer.groups.VIP_Customers

The following condition checks if balance is higher than zero.

state.isInTransaction && balance > 0

It is important in the case above to check also if we actually are in transaction before we check the balance.

The following condition checks if there is customer on the transaction.

customer

The following condition checks if store is number 5.

pos.store = 5

Last updated

Was this helpful?