4.19. How to Select Portions and Order Tags By Popup?
In this document, it will be explained how to select Portions and Order Tags from a Popup Screen.
This example, doesn’t allow you to make multiple selections at the same time from the Popup Screen. If you want to select multiple features, then, click on that product and make the selection from the right side of the screen.
Requirements;
- Version 5.1+
- SQL Server Express
- GraphQL – make sure you can access to http://your_server_name_or_ip_or_localhost:9000
How it works;
1. Adding Script
Go to Main Menu > Manage > Automation Commands > Scripts > in here click on Add Script link.
Name: Order Modifiers
Handler: order
Script: Copy below code group and paste it into script field.
function getOrderTag(product,portion,returnType,key) {
|
After completing necessary editings, click on Save button.
2. Adding Order Tag
Go to Main Menu > Manage > Tickets > Order Tags > in here Add Order Tag link.
General Settings Section;
Name: Choice of Sauces and Spices
Min Selected Items: 1 (It forces you to select at least 1 feature)
Max Selected Items: 0 (You can restrict max selection by typing any number here, if you write 0, you can select as much as you want.)
Add Tag Price To Order Price: Select this box if you want to add order tag’s price to order’s price.
Order Tag List Section;
Add as many order tag as you need by clicking on Add Order Tag link.
Important Note:
The name of tag group will be used in the rule to find the match (In the example “Choice Of”)
Mappings Section;
Add a row by clicking o Add link and select the Product Group that you want to use Order Tags. In the example product group is selected as Salads.
After completing necessary editings, click on Save button.
3. Adding Actions
3.1. Order Modifier-Ask Question Action
Go to Main Menu > Manage > Automation > Actions > in here click on Add Action link.
Action Name: OM-Order Modifier-Ask Question
Action Type: Ask Question
Parameters:
Question: [:Question]
Buttons: [:Buttons]
Description: [:Description]
Automation Command Name: [:Command Name]
Execute Command In Background: [:Exec in Background]
Background Color: [:Color]
Transparent Color: [:Transparent Color]
After completing necessary editings, click on Save button.
3.2. Order Modifier-Update Order Action
Go to Main Menu > Manage > Automation > Actions > in here click on Add Action link.
Action Name: OM-Order Modifier-Update Order
Action Type: Update Order
Parameters:
Name: [:Name]
Quantity: [:Quantity]
Price: [:Price]
Portion Name: [:Portion Name]
Price Tag: [:Price Tag]
Increase Inventory: [:Increase Inventory]
Decrease Inventory: [:Decrease Inventory]
Calculate Price: [:Calculate Price]
Locked: [:Locked]
Disable Portion Selection: [:Disable Portion Selection]
Tax Template: [:Tax Template]
Account Transaction Type: [:Account Transaction Type]
Warehouse: [:Warehouse]
Update All Orders: [:Update All Orders]
After completing necessary editings, click on Save button.
3.3. Order Modifier-Tag Order Action
Go to Main Menu > Manage > Automation > Actions > in here click on Add Action link.
Action Name: OM-Order Modifier-Tag Order
Action Type: Tag Order
Parameters:
Order Tag Name: [:Tag Name]
Order Tag Value: [:Tag Value]
After completing necessary editings, click on Save button.
4. Adding Rules
4.1. Order Modifier-Ask For Portion Rule
Go to Main Menu > Manage > Automation > Rules > in here click on Add Rule link.
Rule Name: OM-Order Modifier-Ask For Portion
Event Name: Order Added to Ticket
Execute Rule If: Matches
Add Custom Constraints:
{PORTION COUNT} | Greater | 1
Select Actions:
Action 1: OM-Order Modifier-Ask Question
Question: Please Select a Portion
Buttons: {PORTION BUTTONS}
Command Name: none
Color: Firebrick
Action 2: OM-Order Modifier-Update Order
Name: [:MenuItemName]
Portion Name: [:CommandValue]
Update All Orders: False
After completing necessary editings, click on Save button.
4.2. Ask for Modifiers Rule
Go to Main Menu > Manage > Automation > Rules > in here click on Add Rule link.
Rule Name: OM-Order Modifier-Ask for Modifiers
Event Name: Order Added to Ticket
Execute Rule If: Matches
Select Actions:
Action 1: OM-Order Modifier-Ask Question
Question: {CALL:order.getOrderTag('[:MenuItemName]','{PORTION}','name','Choice Of')}
Buttons: {CALL:order.getOrderTag('[:MenuItemName]','{PORTION}','tag','Choice Of')}
Command Name: none
Color: Firebrick
Action 2: OM-Order Modifier-Tag Order
Tag Name: {CALL:order.getOrderTag('[:MenuItemName]','{PORTION}','name','Choice Of')}
Tag Value: [:CommandValue]
After completing necessary editings, click on Save button.