satianv@hotmail.com's picture
Jun 23, 2013
6034 views
Reputation: 14

How to add discount to Price+modified Options in an item?

Hi there,

 

First of all thank you thank you thank you for a fantastic product.

 

I have currently moved to version 3.07 and struggling to achieve the following :-

 

I have a  dish ie:  Curry  with Options : 1 Vegetable 2 Chicken 3 Beef. I have created a order tag that assigns the "Options" to the ""Curry". in example in my pos screen if I click on the "Curry Button" I get to choose "Veg" "Chicken" or "Beef". Now depending on the option I click a price entry is updated from the "order tag - Add to price option"

 

I need to take the total value for this ie: Curry+ChickenOption and then allocate 50% discount to it.

 

I have followed Emree's suggestion as per the link below.

http://www.sambapos.org/en/content/how-add-50-discount-button

But the outcome is wrong when the price is added up for the options ie: If I select "Curry" and no option  the 50%discount works fine  but

If I select "Curry" +"Chicken option" the 50% discount throws wrong figures.

Apologies for the long question but could you please assist. Again thanks for this wonderful product.

 

regards

Satian

7 answers

emreeren's picture
emreeren
Jun 23, 2013
Reputation: 595

Can you try using Order.GetVisiblePrice() instead of Order.Price on discount calculation expression? In order to make it work be sure to enable Add Price to Order Price for all order tags but not discount tag.

satianv@hotmail.com's picture
satianv@hotmail.com
Jun 24, 2013
Reputation: 14

Hi Emre,

Thanks for your quick reply. I have edited the "%50Off Add" Action to have this "PRICE: [=Order.GetVisiblePrice() / 2]   ORIGINALLY it was  [=Order.Price / 2]

This has stopped the command from working at all ie: when I click on the button nothing happens to the Price only the "ticket details" are changed to show 50%off status.

What am I doing wrong?. Is the "Price" field within the command that I need to change as above or is there something else that I need to update as well?

 

Thanks

 

 

emreeren's picture
emreeren
Jun 24, 2013
Reputation: 595

Can you try Order.Model.GetVisiblePrice() ? Sorry for the try-error thing but it helps alot for understanding how expression feature works.

satianv@hotmail.com's picture
satianv@hotmail.com
Jun 24, 2013
Reputation: 14

Hi Emre,

order.model.getvisibleprice() gives the same output as order.price 

Thanks for helping. Let me know your thoughts

emreeren's picture
emreeren
Jun 25, 2013
Reputation: 595

OK Let me test that. I'll be back soon.

satianv@hotmail.com's picture
satianv@hotmail.com
Jun 25, 2013
Reputation: 14

Hi Emre,

Some additional discovery here :-

Reverting back to [=Order.Price*0.5], I have figured out that the following sequence returns the correct value.

1) select the Order Item+Select Options ie: Click Curry and then Chicken it shows the value ie Base Curry Price ($8)+Chicken Option Price (Added via order Tag $2)= $10

2) Select the "Curry Item (chicken tag) $10" . Hit "50%Off" button .

Wrong Figure displayed.

3) Select "Curry Item (chicken tag) $10" . Deselect "Chicken" revert to Base Curry

Correct figure is shown ie: $5  

Not sure if this information will be useful in your testing. Also where can I find all the environment variables like Order.Price etc listed. Is it on this website?

 

Thanks

emreeren's picture
best answer
emreeren
Jun 26, 2013
Reputation: 595

Thank you very much, this resolved the issue. You are a magician and genius bundled together. Love your work!!

 

We have already answers to
1029 questions
E-Posta Facebook Twitter RSS Skype
Telefon (212) 252 0634