Handeling Half Pints

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

Still have the issue that if half pint button is pressed and non draught item added samba crashes.
I imagine I need a constraint.
have tried group code = draught on whole rule but this then means the half pint program setting is not cleared,
ideally the group code = draught wants to be on the update order portion action leaving the clear half pint program setting to be cleared but not sure what code to use, tried ‘[:GROUPCODE]’=‘Draught’ based on things seen on other posts,
am I close?

As an update I sorted the crash and ALSO to use a ‘DUMMY’ product so to have haft pint button on the menu list.

My setup is:
Action - Update Setting (As you post)
Action - Portion to Half Pint
Action - Cancel Last Order

Half Pint Product 0 price on draught menu

Rule 1 - Half pint product added (menu item = HALF PINT) = update setting HP_Portion to Half Pint & cancel last product
Rule 2 - Order Added (if group code = Draught & Setting = half pint) = update order portion to half pint
Rule 3 - Order Added (if setting = half pint) = update setting to"" to clear the setting if pressed by mistake.

This results in pretty much exactly the functionality I was after :slight_smile:
Thanks again for all your help.

Just need to test it with Happy hour prices now which i think will be a challange.

I think ill need two happy hour rules one to compensate for the half pint product update

The VIP & HH Tutorial that I posted operates on fixed discounts, per product.

If you instead discount by the same percentage for each product, no matter the Portion, then you could change the discount calculation to derive the amount based on the Order Price.

[=-1*(TN('{ITEM TAG:HH}'))]

Becomes:

[=-1*(TN('{PRICE}') * TN('{ITEM TAG:HH}')/100)]

This product has a regular price of 60 and HH discount of 10. Original setup would apply -10 fixed discount. I changed the calculation to turn it into a percentage instead. So now the discount applied is 10%, which for a product priced at 60 would be 6.

If the percentage discount won’t work for you (i.e. if you need to use Fixed discount), we have another work around for Portions…

Create another HH Product Tag to use with 1/2 pint Portions. Name it HHhalf or similar. Then use the Product Tag Editor to set the discount amount for HHhalf.

Now change this Rule:

Add another Action of the same Type, and change the Constraints and Order Tag for both Actions…

How could you add the {SETTING:HP_Portion} = Half Pint constraint in on the action of the rule?

At the moment I have got to have two happy hour actions and two happy hour rules - one general happy hour and another with a rule constraint of {SETTING:HP_Portion} = Half Pint
because the general rule used happy hour price band with no portion it overights the half or visa versa the half pint update order overights the happy hour price band.

If I can have a single happy hour rule with two actions - happy hour and happy hour half i can constrain the actions so that the half pint happy hour updates price band and portion and the other just the price band.

Does that make sense?

I am not in a position to offer help. I will be later today. If you have not figured it out by time I get home from the restaurant I will help you look at this.