Promotion Set by Quantity Issue

i have a promotion if you order 2 bottles its for 70

i have try to set like this but its doesnot seem to work



or this


some more i notice this if i use 5 as input it will 5 x 24 give 120

@Jesse i have try your way also but still not working
i have try by removing separator also

i have also try to show a simple message but the constraint dont seem to work

So what we need to do is narrow it down to what the problem is. If you think it is the constraint then try other constraints. The one I posted works thats proven. So we know it can work the issue is your wanting to set it up slightly different so now we need to figure out where yours broke. More than likely its the constraint.

i have try that also…

under this rule


if i type 2 from numberpad the rule works
if click twice on product it doesnot work

somemore the monday lunch prormotion action doesnot work on both data entry

what is MOnday Lunch Promotion? Its likely this may need to be modified to work. A lot has changed since we last discussed this idea.

its just a message i added to know when will it trigger ?

Personally I feel this should be redone using custom product tags. I think its a better solution.

ok so this is what i want to achieve
1 bottle = 38
if 2 bottle purchased
2 bottle = 70

so any link for reference

I have not looked into this since september and I was not planning on using it so I have no data to show you atm. If I were building it I would probably start with a Custom Product Tag called Promotion X or something similar. I would flag it as Y or N and then write the constraint so it flags the item based on QTY when order added. I would then use a constraint that looks for that flag and update order for price if it is Y.

Heck might use states for this…Order states might work better. Lots of options. I really do not want to spend time building it atm because its not something I am using.

ok i understand…can i know how can i subtract from the Visible price

like
[={PRICE} - 8]

[=F(TN('{PRICE}')-8)] Should work Maybe just [=TN('{PRICE}')-8] will work I cant remember exactly.

ok thanks i will try and let you know then

in this post i asked about that

if you finally get it, plese guide me to do it too

It was working just fine for me when I was playing with it back in September… I did not save it because I do not use it. But I do not see any reason why it cant be done now. Matter of fact I am confident it can be done. Put your heads together and start trying some stuff I can help you through the process if you provide some details of what you have gotten so far

2 Likes

@kendash i have try your approach
its working if i put 2 only but by pressing twice the menu button


not if i add quantity 2 from numberpad

then i wanted to use another approach
count the quantity of product and if divisible by 2 reduce the price


in this scenario if i add 1 quantity it will reduce the prize and if i enter 2 no action taken

How to use MOD (%) operator in Constraint?

using this:
input 1
output: 1

trying to multiple of 2

Understand that you need to make some kind of comparison in order for a Constraint to work, which you are not currently doing. Since the Mod operator will return the REMAINDER of a division, your Constraint could be this…

[=TN('{TICKET QUANTITY SUM:White Wine}') % 2] == 0

or depending on what you’re going for, inversely, this:

[=TN('{TICKET QUANTITY SUM:White Wine}') % 2] != 0

EDIT: a safer comparison might be to not use the Mod operator (%) at all, and instead use the Integer Division operator (\), and compare it against the Regular Division operator (/):

[=TN('{TICKET QUANTITY SUM:White Wine}') / 2] == [=TN('{TICKET QUANTITY SUM:White Wine}') \ 2]

Inversely:

[=TN('{TICKET QUANTITY SUM:White Wine}') / 2] != [=TN('{TICKET QUANTITY SUM:White Wine}') \ 2]

EDIT2: you can disregard the notion of using the Integer Division operator (\) since it does not seem to be available - it does not produce a result.

@emre, I remember you mentioning that you might be switching to a different Scripting Engine with expanded function support in some regard. Are there other functions we could use, like casting values, for example [=int(x/y)], or using something like Floor()?


EDIT3: this should do the trick:

[=FF('{TICKET TOTAL}','#')] … Strips decimal parts from numbers.

In your case:

[=FF((TN('{TICKET QUANTITY SUM:White Wine}')/2),'#')]

So you could compare decimal division to “integer” division like this:

[=TN('{TICKET QUANTITY SUM:White Wine}') / 2] == [=FF((TN('{TICKET QUANTITY SUM:White Wine}') / 2),'#')]

Inversely:

[=TN('{TICKET QUANTITY SUM:White Wine}') / 2] != [=FF((TN('{TICKET QUANTITY SUM:White Wine}') / 2),'#')]

The message below shows:

Quantity (Q): 5
Divide Decimal (Quantity/2) (D): 2.5
FF(Q/2,'#') (I): 3

Q:[=TN('{TICKET QUANTITY SUM:Cookie Signature}')] D:[=TN('{TICKET QUANTITY SUM:Cookie Signature}')/2] I:[=FF((TN('{TICKET QUANTITY SUM:Cookie Signature}')/2),'#')]
1 Like

thanks @QMcKay after posting i realized i had to make a comparison but didnt get the time to work on it.

thankyou for providing different solutions but i need to know integer division returns an integer after rounding the quotient?

i will work on it later and will update

I would try the above as a constraint. It is essentially testing “decimal” division against “integer” division. If "decimal" == "integer" then you have a Quantity that is evenly divisible by 2, so you would apply the discount. If they are not equal, the Action will not fire, meaning that the Quantity is not evenly divisible by 2.

@QMcKay now that i have tried this the same problem that i was facing earlier with different method exists

that is if i enter White Wine five times the effect doesnot take place
and if enter 5 from numberpad the constraint is working

maybe refresh ticket might work here let me try!!!