Constraint for portion of a product

Trying to make this rule work only for the portion With Sibling.

Weve currently set discount to 0.01 for now but ideally want it to gift

have tried:

{PORTION} = With Sibling
{PORTION NAME} = With Sibling
{PORTION:With Sibling}

Found this, but with no success using as constraint

Think you will be wanting order portion changed event rather than order added…
Remember that generally portion is updated after adding the order and first portion selected by default.
Order portion changed has portion name and portion price as built in constraints already.

1 Like

Of course, that somewhat works

However if the portion is changed back it stays as gift… maybe I should reverse that rule to reflect that.

I’m trying to get it to show this after customer selected, I tried refresh ticket but to no success, any idea on that?

EDIT:

Yes copying the cancel gift rule within a new rule to reflect above works, just need to to refresh the ticket

Im a little unsure what your trying to do… LOL

It wont undo just because you changed back, constrints are only progressive filters, they simply dont trigger if values not met. You would want to revers on changed to not be that portion, similar to the way described when discussed cleanup rule for unselecting entity.
Maybe add an extra sonstraint to check if order gstatus is already set or not to avoid posible issues/conflicts with other flows.

basically ive copied the gift rule to automatically work to a certain portion if selected if a VIP Level =1 (as you cant do zero price on Price Lists and product tags only do per product not portions)

Ive then copied the cancel gift rule to do the same as above if the portion is changed. All works flawlessly.

Now the issue is, if the product portion is selected, and then a customer card is swiped the Gift status doesn’t apply…

However… thinking about it, I may be able to integrate that into the entity selected rule…

Yep :slight_smile: that should be workable

Ok so tried this, but I think my custom constraint is wrong?

Want to fire that action only for that particular portion name

So how would entity know what a portion is?

1 Like

Is that not what my constraint is telling it?

You should test that event to see if it can even read {PORTION}. I doubt it can.

When your designing rules you should think of what it is doing. Does it make sense that Entity Updated would have any idea what the portion of an order is? No its only concerned with the Entity.

PS I have not tested it but you could save yourself headache with simple Show Message action and test if it has access to {PORTION}

2 Likes

It cannot. Entities are Ticket-level. Portion is Order-level.

Also, you should not use the TN() function because it will take the Portion, which is a string, and attempt to convert it to a number, which would return ‘0’ in this case.

2 Likes

No don’t see it… hmm, this is gonna be a challenging one for me

I am still a little confused on what your trying to achieve. It sounds like your initial approach is wrong. If your wanting to automate a discount based on order level portion when an entity is applied then you would have to loop through all orders checking portions and apply discount in the loop.

The action your wanting to do is Order Level but the event is ticket level.

My question is why do you want it to be based on Portion? You could use Order States for that and it would be a simpler automation.

Ok, so… is there a way of refreshing the ticket so that it can see what items should be gifted?

Flow at the moment is:

Orders Selected > Customer shows Membership Card, Card is swiped > Under 1 with Sibling SHOULD be free, so therefore Gifted, but only happens after the card swiped.

Id like the POS to see what items should be gidfted after the card is swiped and automatically gift them.

I have the rules set so that when the that particular ‘portion’ is selected it gifts, and unselected gift is removed… but ideally id like this to happen automatically after card swipe

Ok but why do you need it based on portions? Are only certain portions giftable?

POS is set up as

Product = Under 1
Portion Normal
Portion Free
Portion With Sibling

Would be damn easier if Product List could do zero prices though

OK so your not really using portions as portions. Your using them as a tagging method. What the heck is an Under 1 ? lol

Obviously your not selling food… can you explain from start what your doing?

Child lol

I may be going about this the long way…
Normal Price is £1
With Sibling is 50p so technically discounted by 50p

So If I set the With Sibling as £1 and do a discount based on sibling via product tag… then itll take 50p off, and if VIP price is 50p, thatll make the order £0.00

Ill speak with the owner to see if he will let me go about it this way

Matt