Ternary Expression in State Display Format?

Should we be able to use turnary expressions in state display formatting?

[= '{{ORDER TAG:Special Tag}}' == '' ? '{SETTING:[:MenuItemName] Price} Special' : '{0}']

OK, need double curlies on both tags;

[= '{{ORDER TAG:Special Tag}}' == '' ? '{{SETTING:[:MenuItemName] Price}} Special' : '{0}']

Guessing we cant use turnary in display format;

@emre any chance of this?

Correction on the expression;

[= '{{ORDER TAG:Special Tag}}' == '' ? '{{ORDER TAG:Special Tag}} Special' : '{0}']

I was hoping to use update order to set the order name but predictably this is not good idea given things do use menu item name.
Turns out its possible to change order name to non product name with this action but settle button doesnt work if you do.

Anyone have any ideas?

Have no time to check if Display Format support Order State,
Maybe you can set Order State to {SETTING:X} when today special add to ticket.

EDIT: You may have problem that it won’t refresh (maybe refresh after another order add to ticket)

1 Like

I thought about that, but was hoping for ternary as already have a fairly complex order state setup on my hotel system.

Its not a deal breaker as should be able to achieve desired print out at kitchen as is but would make life allot easier for user.

You can use {CALL:X} to execute javascript while rendering orders.

2 Likes

Taken a while but back on this.
Have tried but cannot work out how to pass order name to script.
Also cant get returned value to output when using $1 or {0}.

Want to set the visable name to be a order stag for the special option from planned specials setup.
So am thinking call script in state format inputting order name, if order name is the base special product the script returns the order stag for specials (currently freetag but plan to set a specials free tag group to seperate encase other free tags used.
However $1 or {0} do not render the order name into the script. Quoted script gets either $1 or {0}.
Unquoted doesnt work.
Returning $1 or {0} from script doesnt render the corresponding value.

image

image

image

Sorted, had to use {Name} or {PRODUCT NAME} as I need in the end.