VIP & Happy Hour (or timed special) Discounts without Triggers


#23

Me and Q are going to hook your brain to a hidden feature discovery device one day.


#24

lol I hope it doesn’t hurts. Once a friend offered me to wire my brain to a device and give electricity to improve my coding performance. He is a medical doctor and what he talking about is a medical device he invented… Guess what I did :slight_smile:


#25

Hi Guys just to let you know have done it Here’s What i DID :-
Created afternoon HH

Then ADDED 2 more HH Store HH Day and Time to the HH Reset Day Time PriceList on App Started and Named them HHstartTime2 and HHendTime2.

Then Created a Second rule to match the first rule CD Update DiscountType State for HH 2 but changed the Constraints to HHstartTime2 and HHendTime2

Original…

Added…

Then amended Given Actions With - or [=TN(’{SETTING:HHstartTime2}’)] and [=TN(’{SETTING:HHendTime2}’)] inside HH Update PriceList and CD Check Order Time from VIP to HP and set HH or ND

‘{DATE:ddd}’==’{SETTING:HHstartDay}’ && [=TN(’{DATE:HHmm}’)]>[=TN(’{SETTING:HHstartTime}’)] or [=TN(’{SETTING:HHstartTime2}’)] && [=TN(’{DATE:HHmm}’)]<[=TN(’{SETTING:HHendTime}’)] or [=TN(’{SETTING:HHendTime2}’)]

and thats it i Think - Done…

Thank you so much guys for putting me in the right Direction…


Adding in HH Rule
#26

Where does the tutorial for “HH Store HH DateTime” action?, i have imported the through DB Tools but the such action doesn’t exist, neither does on tutorials above.


#27

The Action is in the Tutorial here…

Name: HH Store HH Day and Time
Action Type: Update Program Setting
Setting Name: [:HHname]
Setting Value: [:HHvalue]
Update Type: Update
Is Local: False


#28

Thanks, so change all “HH Store HH DateTime” action into “HH Store HH Day and Time” in all rules?.

[Edit]
I answered myself sorry, so it’s on tutorial’s image it’s “HH Store HH Day and Time”.


#29

hello @QMcKay
Very good tutorial, I followed every step of totorial for an hour and everything worked properly, but after an hour the configuration Happy Hour stopped working suddenly.
revised every configuration step by step, as explained by the toturial, but not managed by again running the Happy Hour.
can you help me
How do I force the startTime Manually?


#30

You can set the start/end day and time in the Rule that you are showing, then exit SambaPOS and start SambaPOS again.

Alternatively, you may want to use User Login event rather than Application Started event, so that you just need to edit the start/end, then logout and login.

You could also put together another simple flow to prompt for the start/end time and store those values immediately without needing to restart or logout.

However, you need to keep in mind that any open Tickets will be affected by the change in time. This is because when you open an un-settled ticket, the implementation will cycle through each order on the ticket and change it’s discount state based on the start/end time that you have set compared to the Order Time. This is by design in the way the Tutorial is set up to work. If you want to arbitrarily change the time throughout the day, it will not work for you because of this.


#31

His Happy Hour design was to work with specific Times and Days. If you want a manual start stop Happy Hour then you need to configure it differently. You could configure it to be triggered with a button but it would require extensive redesign of rules and actions and it would essentially be a different tutorial and not part of this discussion.


#32

Thank you, I’ll follow these steps.


#33

@QMcKay I tried several events name, such as: work period started, login and more … but still can not succeed, again I reviewed the whole tutorial, and I for sure I’m doing everything right, but not working.

help me


#34

apologize for the captured photo in constraint is Matches and not Equal
by equal I tried to see if it works, but also does not work.


#35

Put a Show Message action in that Rule to display something so that we know it is firing properly in the first place. If it is, then we can go from there.

If not, you need to consider changing the constraints (i.e. why are you constraining to Administrator only? Just curious.)

Message:

HH BEG:{SETTING:HHstartDay} {SETTING:HHstartTime}\rHH END:{SETTING:HHendDay} {SETTING:HHendTime}


#36

Btw if you want it running every day then no need to constrain it to days also no need to store day just do time.


#37

Wok Perfect


#38

Right, so your constraint for Mon|Tue|Wed, etc would have held it back from firing, since the day is shown as “ter”, not “Tue”.


#39

the problem is in constraint.
when I remove constraint, everything works perfect.


#40

Perfect, my region is Portugal, my language is Portuguese, it makes perfect sense
in this case I can use:

Seg|Ter|Qua|Qui|Sex|Sab|Dom

Not
Mon|Tue|Wed|Thu|Fri|Sat|Sun


#41

In this case you don’t need this constraint as it covers all days. @QMcKay included it into tutorial to demonstrate how to implement date based happy hours. For example if it should work only for Monday and Tuesday you can implement constraint as Mon|Tue (in your language). If you don’t need such constraint and want to make it work for all days you can simply remove it.


#42

Thank you emre. I could understand with @kendash
it was only as an example on Weekdays in my language (purtugues)

I changed the weekdays, but not working.
but when i removed the constraint it work Perfect