problem description
this is a coupon module
there are three kinds of coupons: designated merchandise coupons, supplier coupons, all-purpose coupons;
you can only use one coupon per order
use precedence rules
1, the amount is the largest and meets the conditions to give priority to use
2, if the amount is the same, priority will be given to the specified product-designated supplier-GM will use it from high to low priority
now suppose I settle goods An and B from two different suppliers in the shopping cart at the same time ( different suppliers will make separate orders ). Now I have two eligible coupons, a coupon for specified A goods is 20 yuan, and a full-court coupon is 30 yuan. According to the previous rules, A goods will be automatically selected to use full-court coupons, and B will not be able to use coupons.
but if A uses a 20% coupon, B can also use a general coupon. I"m stuck here--
ask the boss for advice! I am a little scum, I am eager for progress!