as the structure of x-cart, orderid is created on the base of providers. there are 3 scenarios.:
- If a customer is purchasing 2 different items from one provider, then orderid will be one and itemid will be 2.
- If a customer is purchasing 2 same item from one provider, both orderid and itemid will be 1 and amount field of itemid will be counted as 2.
- when customer is purchasing 2 items from 2 different providers then both orderid and itemid will be different.
I stuck on the 3rd scenario. there are 2 scopes of discount coupons, either you can give it as percentage
or as flat discount
.
- when I am trying to give flat discount it is counting for both products, let say I am giving a 200RS discount on the product which has 500+ RS price.
Now the issue is there is a loop which is counting discount on products. so when there will be 2 providers discount will be counted on both products because there will be 2 orderids.
when I am trying to break a loop when there is a discount. the site is crashing. there is no way to stop the loop. because if we are stopping a loop, so the data which is needed to order array will be not there and the script will be crash. did anyone face same issue? or do anyone have any solution regarding this?
what I need is discount should be counted on cart subtotal, not on products. have tried too many things but haven't found any solution yet. if you guys have any idea about it, please tell me.
thank you.