Loyalty System: Discount Per Visit

Your entity name is fixed.
Thats your problem with the update!
The action needs the name as in the customers name to know which to update, the action to update doesnt automatically set to the entity for the curent ticket.
You need to [:carry the field] and use something like {ENTITY NAME:Customer} in the rule for the entity name.

You mean like this?

Didnt work at beginning, but found a mistake in the field name. Fixed that.
Now its working again!

I wonder how it worked before then. The name customer was fixed but i thought it would grab the correct entity as it worked before.

Weird. Its working now so thats good. Lesrnt something new here. Thanks.

Maybe if you don’t specify an entity name it autoselect current.
Wernt you using different t flow with program settings before?

Nah. I scrapped program setting in favor of entity.
Hmm maybe thats true.
Gonna work on now trying to setup, if discount is applied, minus 10 points. If discount applied then removed, return points to original value

If they have multiple tickets in a visit would they get it or only once per ticket?

So you will want to add those steps to your ask question automation command rule.
Allong with a ticket state in order to map buttons to.
Something like Discount=
So you can have Apply discount for discount= (null)
Set discount= applied on your apply rule.
Remove discount rule to remove calculation, add points back and set discount state back to ‘’ (null/blank)

I think in this case each time they spend would apply a new point is fine.
As long as its set on a new ticket.
So the current flow I think is ok. Though your suggestions are much appreciated.

I will be working on this again today when I get back in the office.

Is this the same Ask Question ticket that checks Discount Eligibiity?

So we create a ticket state to apply to auto command button, and setup a rule for it similar to how you did yours in the loyalty points you created yeh?
I’m just not sure what constraint I would add to add the points back if discount is removed.

Constraints on the remove discount button shouldn’t be a huge issue as you will be setting the button live using the ticket state you set when you apply discount so will only be available once discount is applied

Ok So finally back at this.
Here is my automation Command

And the rule that I created.

I followed the tutorial for your loyalty with the idea, however I think that my constraints may be wrong here.
Is my discount constraint correct?

EDIT: I dont think the ENTITY NAME:Customer IS NOT NULL Constraint is correct or the even name either.
The difference I found between yours and this one is that the entity data changes.
Where as this one the data doesn’t change, only the total amount changes.
So i thought giving Ticket Total changed event, and applying [=TN(’{CALCULATION TOTAL:LoyaltyV1_Discount}’)] Greater than 0 constraint. However that didn’t work too.
I checked the state names and they appear correct. Hmm

Ok I’ve managed to fix it.
Turns out i don’t need a new rule at all.
Instead I updated the state as soon as the discount is applied on my apply discount rule
And I amended my remove discount rule to change state to not show the button after discount has been removed.

So far here is what it all looks like.

Ok so far we have done the follow

  1. Created a Visits Entity section under Customers entity.
  2. Created a rule to add 1 point for each time a ticket is settled with their name selected.
  3. Created a rule which fires if customer has more than 10 visits to apply discount.
  4. Created a rule to show cancel discount only when a discount has been applied.

Things to do now

  1. Create a constraint or rule that removes 10 points whenever loyalty discount is applied.
  2. Create a constraint or rule which puts 10 points back if discount is cancelled while ticket is still unpaid.

I Suppose I may have to amend the Cancel Discount Rule where I have to add an action to add 10 points of Cancel discount is pressed.

I may also need to amend the apply discount rule to minus 10 points if discount is applied.

Ok I think I made it work!

Here is what I did
In my Apply Discount button. I added a new update entity data action to -10 points if loyalty discount is applied.
Then if Cancel is pressed, I need to re-add those 10 points.
So I added another Entity Data update action to my cancel discount rule

Here is the result

What do you think of this method?

Any suggestions? Anything you think I should improve or change or add to make it better?

1 Like

Id call it visit points, visits back to 0 looks wrong lol

1 Like

Haha fair enough. Thats a good point. Easy to change.

Im thinking of adding entity card scan next which should be pretty easy.

We could take it further and make it ranges of points and add discount levels.

Eg accumulate 50 points, recieve 30% discount… cap at 100 points, recieve 1 free meal and 10% discount. Something li’llke that

1 Like

I use rfids for our loyalty discount.
My I have a staff discount level too and have a fireld for staff username which it the checks to prevent a member of staff using their own for while they are logged in. Doesn’t stop them swapping fobs but one better than nothing.

Hey guys am a bit lost of this; What Action type can be used for this Action? Discount

I would say that action is ‘Update Ticket Calculation’.

1 Like

Hey am trying to put a timer which will cause the visits to auto reset to 0 after a week or 2 or monthly. Any guidelines?

Think you might be better to look at it the other way round.
Log the date of last visit and constrain date against last visit.
Resetting to 0 will need a script to run through all entities.

I have decided to use an AMC to reset manual while I try to gather more knowledge about constrains. I have created this to handle that

But its only working when I select an Entity. Want it to reset without having to select a customer
Any info how I may achieve this without selecting an Entity??

Surprised that works…
Entity name your putting in your number of visits, field value your using an expression which is returning false/0 which maybe works cause thats value you wanted but not how you should do it.