Question on a list control with our POS. We want to run a Buy One Get One Free sale and want the POS to calculate the free item automatically.
The free item should have the following conditions:
1. Be equal or lesser value
2. Belong to CATEGORY 1 through 12 (different clothing genders and sizes. Want to specify what's on sale)
I have an Xbasic script that looks up the product and pull the values, and then passes it to Javascript to add the list row based on conditions - if it's on sale, percent off, set price, etc.
What I want it to do:
Calculate the record count.
If it's an odd number, ignore the odd one with the highest PRICE.
Compare the remaining even number of records, take the lowest PRICE half and set the discount to '100'.
That should in my mind do the job to give the customer the free items which is of equal or lesser value.
Ideally, this runs each time a product is scanned. OR, there could be a button on the UX control that calculates this all once the scanning of products is done. I assume the latter would be easier?
List control = 'ORDERITEMS'
Price field = 'PRICE'
discount field = 'DISCOUNT'
Any help in the right direction would be appreciated. Stared at this for 8 hours now and I just can't get it started.
Thanks in advance!!!
The attached image shows the example. One of the 3.99 items should be ignored, and one of the 2.99 and 1.99 should be set to zero.
GRAPHICS-0018.png
The free item should have the following conditions:
1. Be equal or lesser value
2. Belong to CATEGORY 1 through 12 (different clothing genders and sizes. Want to specify what's on sale)
I have an Xbasic script that looks up the product and pull the values, and then passes it to Javascript to add the list row based on conditions - if it's on sale, percent off, set price, etc.
What I want it to do:
Calculate the record count.
If it's an odd number, ignore the odd one with the highest PRICE.
Compare the remaining even number of records, take the lowest PRICE half and set the discount to '100'.
That should in my mind do the job to give the customer the free items which is of equal or lesser value.
Ideally, this runs each time a product is scanned. OR, there could be a button on the UX control that calculates this all once the scanning of products is done. I assume the latter would be easier?
List control = 'ORDERITEMS'
Price field = 'PRICE'
discount field = 'DISCOUNT'
Any help in the right direction would be appreciated. Stared at this for 8 hours now and I just can't get it started.
Thanks in advance!!!
The attached image shows the example. One of the 3.99 items should be ignored, and one of the 2.99 and 1.99 should be set to zero.
GRAPHICS-0018.png
Comment