This works fine for our purpose.
My question is how can I change a state “LStatus” to ‘Loyalty’ when one of the Loyalty buttons is pressed.
The reason being that when a loyalty card is used we print 2 tickets (one for us and one for customer), so I want to test for the LStatus in the Execute Print Bill.
Possibly not the correct way to achieve this, but it is simple and works up to the printing 2 tickets.
You probably could trigger this to happen “when the button is clicked” using an automation command assigned to that menu item.
Create an “order added to ticket” rule with a constraint of Product Name Starts “Loyalty” and then add an “Update Order State” action to your rule to set the state correctly.
Finally, by far the easiest way to achieve this is to go to Admin > Products > Menu and then click on “Edit Product Properties” and in that table you can set the order state by putting LStatus=Loyalty in the Order State column.
You might need to set and check a Ticket State instead. Because how is the Print Bill button supposed to know which Order State for which Order that you want to check?
So when you click a Loyalty button, have it set a Ticket State and then when Print Bill happens, check that Ticket State.
On order added you have containes as a constraint in middle dropdown.
And sure product name will be a preset first dropdown.
And type loyalty on the 3rd box rather than using dropdown.