Handeling Half Pints

i have triggers for a timer for the hour it runs which sets price tag to HH for second price list where entries are in for items included in deal, others remain on regular price

by looks of it the order update overites the HH tag back to blank

Oh I do not prefer the triggers. Let me find a link to a much better way. You do not have to use triggers for this. You can set constraints let me show you.

This is a great tutorial its rather advanced and you may not need all of it. But look at this and study it it will teach you some advanced functions of Samba.

thanks
will look now

One main reason I prefer this method is Triggers will not run if ticket is open… so for example if its 2:58 happy hour starts at 3:00 you open a ticket at 2:59 add the drinks etc and close ticket at 3:05 then that customer did not get any happy hour prices. Even though it may have been 3:00 when you added the orders.

With the non trigger setup it doesnt matter. If you start ticket at 2:58 and add drinks at 3:00 it will give the happy hour price.

THe reason Triggers do not run if ticket is open… Triggers were really meant for other things like running database backups or other tasks. You may not want a triggered task to happen in middle of a ticket.

EDIT: I want to stress if you do attempt this be sure you check everything carefully. The smallest typo can break the setup and it wont work. There are some very advanced expressions etc.

fair point, just running though it now.
have backed up

I use a concept similar although on a MUCH more basic level for tracking what time of day my sales happen. You can see this here: Not the same thing but its a concept inspired by the other one. This one just uses Ticket Created event and {TIME} tag while the other one uses Order Added and more advanced methods.

But it still shows various ways to accomplish timed events without triggers.

Sorry for multiple posts… But I wanted to make the point that if you do attempt to build this or something based off this it will expose you to several advanced functions of Samba including States, Expressions, Constraints, Action Constraints, Product Tags, This will be a great practice for you to get more familiar with samba and gain confidence to really unlock its potential.

am half way through and spotted a potential issue… portions dont show on product tag list?

Not quite sure why you would want it to be portion specific… does happy hour not run on specific portions? Maybe I am just not understanding your use? Can you explain why this might be issue?

happy hour is 50p a pint off, so 25p off on a half, havnt finnished but presuming discount of 50p will be applied to half portion same as pint from how it looks

Oh that depends on how you set it up. LIke I said you may want to modify it so it fits your need. You do not have to use it exactly as it was built. But its a good exercise once you understand how it works you can modify it for your needs.

The Product Tags do not have to be what controls the price.

Look here for something more basic but similar. In this one you would edit the new Price List and set your portion prices. It uses that list if specific time is met.

this looks allot easier :smile:
offer is only mon-thur, worked out how to do that on triggers, what would the { } be for this? like day of week?

{DATE} would be used you can format {DATE} however you like and you can set Or modifiers for example {DATE:ddd} use a Custom Constraint like this {DATE:ddd} matches Mon|Tue|Thu

Or {DATE:dddd} Matches Mond|Tues|Wedn|Frid

Ok time for bed for me.

thanks again for all you help.

if your still online before you go as so close to sorting, the half pint order update and happy hour order update contrdict each other,
think as both are updating order
half pint to change portion and happy hour for price list, is there a prefix or code whihc can be put in to prevent overight - ie blank feild of happyhour portion is clearing half pint portion is above it and visa vera?

Make separate actions and don’t use variable for those blank fields. In other words leave them blank in action. Instead of rule.

they are seperate actions and only the corisponding feild Price tag for happy hour and portion for half pint have an entery.

Also try the sorting I showed few posts above.

have done,
time means happy our is applied to pint
half pint button overited the price tag meaning full price half entered no hh taghalf price order update seems to overite hh order update
think its the blank feild in the price tag on the hh action