Conditionally Updating Order Prices

In this tutorial I’ll show you how to automate updating order prices conditionally. We’ll have 3 prices. Breakfast price, Dinner price and ToGo price. Breakfast or Dinner price will apply automatically depending on time of the day. Regardless time of the day ToGo price will activate when ticket marked as ToGo.

##Configuring Prices

First we’ll define price definitions from Management > Products > Price Definitions screen.

Breakfast price will appear as BB on ticket and bills. I’ll create another price definition for Dinner price and tag as DN.

:bulb: I won’t create a price definition for ToGo prices as I’ll use default product prices as ToGo prices.

When I display Price List Editor I’ll see three prices for each product. I’ll use first column prices as ToGo prices. BB is Breakfast and DN is Dinner price. Update prices and click Save.

:bulb: If you leave BB or DN price empty default price will be used.

After finishing defining prices I’ll create a new action to update order prices. Use Automation > Actions screen to create a new action and choose action type as Update Order.

By using Update Order action we can change order line values. I’ll use this action to change order’s price tag so I’m defining a variable for Price Tag parameter.

:bulb: I can use Price parameter to set a fixed price value for order but I need to read defined price for related price tag so I’m using Price Tag parameter.

:bulb: Update Order is a special action that works for selected orders on ticket. If there are no selected order lines on ticket it updates all order lines. When you add a new order it becomes selected while order specific rules working like Order Added. So if you execute this action in Order Added event it updates only related order. If you execute it in a ticket rule like Ticket Closing it updates all orders as there are no selected orders.

:bulb: While defining action I’ve defined [:Price Tag] variable instead of typing a fixed BB or DN price tag value. So I can tell which price tag will apply to order line while executing this action inside a rule.

##ToGo Tickets

Tracking ToGo tickets topic is out of scope for this tutorial. We’ll use Ticket Tags to mark a ticket as a ToGo ticket. I’ll create a Toggle button to Enable / Disable ToGo ticket.

We need an action to Update Ticket’s Delivery Type tag. It can be ToGo or Dine in. Create new action and set action type as Update Ticket Tag

Now we’ll create a button that toggles ticket’s delivery type.

When we enable toggle each button click executes Toggle Delivery Type command with a command value defined in values section. Each click executes next command value. I’ll map this button to ticket on Mappings screen.

We need to execute Update Delivery Type action when this button clicked. I’ll create a new rule to do that.

Our default Delivery Type will be dine in so I’ll create a new Ticket Created rule to set default Delivery Type as Dine in.

Create a new ticket to see if default Delivery Type correctly updates and if Clicking ToGo button toggles delivery type correctly.

##Price Automation

Now we’re ready to configure how prices will change. Assume we need to update prices as…

  • Default price will be used for all ToGo tickets.
  • BB (breakfast) price will be used for Dine in tickets until 01:00 PM (13:00).
  • DN (dinner) price will be used for Dine in tickets after 01:00 PM (13:00).

So we need to update prices…

  • When a new order added to ticket.
  • When delivery type toggles.

:bulb: We need to update prices when delivery type toggles as operator can change delivery type after adding orders. While adding orders dine in prices will apply but when operator changes delivery type as ToGo we need to change all order’s prices.

IMPORTANT!!! Must Read: When we have multiple cases to implement it is a good idea to implement it without attaching it to a specific rule. To do this: I’ll create a temporary button that updates prices when clicked. When I ensure it works fine I’ll delete button and make it run automatically. By using this technique you can easily test if your implementation works fine and you can easily map actions to multiple rules.

I’ll create Update Prices button and map it to Ticket.

I’m mapping it to Ticket.

You should see button here:

Now I’ll create 3 Rules that works when Update Prices button clicked. When you add orders, change delivery type and click Update Prices button, order prices should change accordingly.

####ToGo Price Rule

We’ll create a new Automation Command Executed Rule that applies default prices when ticket’s delivery type is ToGo.

:bulb: I’ve used {TICKET TAG:Delivery Type} tag to read selected Delivery Type for ticket.

:bulb: Add a single space for Price Tag parameter to leave price tag empty and apply default prices.

####Breakfast Price Rule

While applying Dine in prices we’ll also test time of day. We’ll apply breakfast prices if time is before 01:00 PM. I’ll create a new rule that applies Breakfast (BB) prices if Delivery Type is Dine in and time is before 01:00 PM (13:00).

:bulb: {DATE} tag returns actual date & time. As I can define formatting for this tag I’m using it as {DATE:HHmm} to format time as HHmm. HHmm formatting returns time in 24 hr format. So when time is 03:45 PM it returns 1545. If I need to know time is before 08:30 PM I can assume all values less than 2030 is before 08:30 PM (20:30).

:bulb: Don’t forget to change constraint operator as Matches All.

####Dinner Price Rule

Dinner price rule is similar to Apply Breakfast Prices Rule rule. You can duplicate it or create a new rule to define how Dinner Price rule works. This rule will work when Delivery Type is Dine in and Time is after 01:00 PM (13:00)

###Testing

To ensure prices updates correctly create a new ticket, set delivery type and click Update Prices button to see if prices updates correctly. If you need to find a configuration mistake you can use Show Message action to see how rules updates prices.

Create a new ticket and add few orders. Be sure sure you’ve configured all prices.

Clicking Update Prices button should apply prices accordingly.

Also test if ToGo and Breakfast prices applies fine before automating events.

##Automation

On final step we’ll make Update Prices button to work automatically when an order is added to ticket and when Delivery Type changes.

Updating prices after adding an order

I’ll create a new Execute Automation Command action. This action will trigger Automation Command our Update Price button executes.

I’ll create a new rule that executes this action when a new order line added to ticket.

We’re benefiting from how we’ve setup rules. We can trigger Update Prices anytime we need.

####Updating prices while changing Delivery Type

You’ll remember we already created Update Delivery Type rule to change Ticket’s delivery type as ToGo or Dine in. Now I’ll edit Update Delivery Type Rule and add Execute Update Prices action to update prices after delivery type changes.

##Final test

Now prices should update fine without the need of clicking Update Prices button. If it works fine you can unmap or remove Update Prices button to remove it from ticket screen.

7 Likes

##New Features implemented for this tutorial. (5.1.55)

While creating this tutorial I’ve implemented a feature to define selected value for toggle buttons. If you want to use a toggle button to change delivery type as shown in this tutorial, you can define first value as {TICKET TAG:Delivery Type} to let toggle button determine first value appears on button.

6 Likes

@emre that is what many of users asked about pricing , why can’t we add a report to show in work period like to go sale and dine in sale and another request this can be only done by you hope, to bring the button top of left where select table so it easy to find or toggle. thanks again for the feature many people’s pricing issue solves this hope . What about built in feature different pricing? as most of people use this

Is that not what ticket type and/or department is for? divining sales by types?
Plus the default report will show sales by tags so just this will show you a tag qty and sales total by tag…

how do i add price zero? It always changes into ‘-’ and takes the default price

It can’t be zero. If you mean to give Free items you need to mark order as Gift.

I planned to use this for our staff, they are getting a free main course
All works fine, except i need a zero price for some products (not all products).
So the price definition can’t work for that? Correct?

Currently i have an automation command, and cashier has to point out what’s free

You could create a staff payment type and direct all sales to that account.

Or you could create a Staff Gift button and track it with states.

Lots of various options.

But without understanding your entire business flow it will be hard to recommend something you will be happy with.

1 Like

we use different prices for our staff. Some products are free for them, some half price, some the same price as customers.
I have a separate entity type for staff.
I used this tutorial to automatically select the correct price (free, same or other prices as customers)
All worked fine, except the zero price issue

I have a button to gift a free meal, and change prices; but would like to automate that

1 Like

You can automate the gift function. Its up to you how you want it to work.

PS: this may not be the best tutorial for what your wanting to do. You might explore other options.

Zero price have a different meaning in SambaPOS. In price lists it means you’ll apply default price. In tickets zero priced orders means you’ll setup price later. Useful while processing items that have no standard price like fish.

For gift orders, order should have default price but marked as gift so you can report total amount you processed as gift.

Will you use it for only defining personnel prices or you want it to use together with togo / dine-in feature?

Will a discount based solution work?

only defining personnel prices.

discount based solution can also work … if it is possible on product level
some product 100% discount, other 0%

Ok so I’ve implemented this on version 4 and it works, it does not however take into account portion sizes, even though they are configured in price list it will, once pressed, default to the first price.
Example, you have say a latte at 2.00 normal or 1.80 locals for a regular and 2.20 normal and 2.00 locals on a large.

So I sell a large and press the locals button (which is what I’m using it for) and the price should change from 2.20 to 2.00 but it goes to 1.80 and if i press the line in the ticket opening up the options again the large has changed to regular.

I’m trying to have either a set discount on food groups or two price lists on food and a single button press to take away the 10% on all qualifying products.

Any help much appreciated.

Nick

Show the part of the price list for that product?

Sorry, probably didn’t explain it properly. I am trying to set up a system where local customers get 10% off of specific food category groups only, so I can assign sandwiches to a group and press one button and get the prices altered to reflect this discount BUT excluding drinks and snacks etc.

The above system allows me to do that excellent but it does not work on product tag add ons nor does it work on a large portion even though that portion has a price definition called locals (along the lines of the tutorial). Is there any way to force the price change to look up what portion has been selected before altering the prices? This would solve the issues I am having, alternatively has anyone managed to get a single discount button to work on specific categories only? I have found multiple threads asking for a solution but have yet to come across one.

Thanks in advance

Nick

The portion snag your facing has been discussed on forum.
You’ll be updating order which includes update of portion and if empty it uses default portion, you need the carry the portion field into the rule and put {PORTION} in along with the update price tag so it changes the price tag using the portion currently selected.

As for tags no this method will not involve tags. If you want to include tags on the locals discount you will have to use a discount calculation and use a report type expression to get total for orders in product group and / 10 to calculate 10% discount value.

I only understood part of your reply, could you please change into English everything after “The” :slight_smile:
I will attempt to alter the rule now “gulps”

Here goes…

It’s not working for me. I double checked all proccess to setup, but no effect.