CORE-POS / IS4C

Cooperative Operational Retail Environment
http://www.core-pos.com
GNU General Public License v2.0
63 stars 44 forks source link

Tiered discount coupon #1210

Open flathat opened 9 months ago

flathat commented 9 months ago

We'd like to support a House Coupon with a tiered discount, that is:

Any single one is straightforward but I'm looking for a way for it, as it seems to me, to first try the third option, if that doesn't qualify try the second option, if that doesn't qualify try the third before giving up. The second and third coupon specs would need an "if this fails try this next" option.

Does this seem to be worth trying to support? If so I could code it. Another way of doing it?

gohanman commented 9 months ago

It seems relatively straightforward - a table defining a given coupon's fallback, if any. Third falls back to second, second falls back to first, first doesn't have a fallback.

I think ideally you'd want to use strRemembered and msgrepeat (or something else similar) so when a coupon doesn't qualify but has a fallback, input processing starts over with the next coupon UPC to try. That could be a little tricky to sort out, but if the cycling happens within the HouseCoupon object I'd be worried about running into a scenario where triggering a coupon via fallback has different behavior than manually entering / scanning it.