Cart is Passing Discounts Incorrectly to PayPal
I have an eCart with a Coupon Code Discount Rule. Somehow I am either calculating them wrong, or passing the item index values wrong to PayPal.
Discount itself is working fine:
This 10% discount is correctly applied to a particular item in the cart by using a "coupon" rule.
The coupon is a $_SESSION['PromoCode'] that is set by the customer entering a code "Food10".
The eligible items are Dog Food, which have been given a "Group" column entry of "10".
Example of working cart page and confirm page:
Dog Food $18.00 <---(item to be discounted)
Dog Bowl $5.00
Dog Collar $10.00
Discount Applied: - $1.80
Sale Tax: $2.31
Grand Total: $33.51
Ok, good so far.
The Dog Food is discounted 10%. The Grand Total is correct.
As the cart is passed to PayPal, each item's price value has been recalculated. The actual total is still correct.
Dog Food $17.02 <---(only item that should be discounted)
Dog Bowl $4.73 <---(should not be discounted)
Dog Collar $9.45 <---(should not be discounted)
Item total $31.20
Total: $33.51 <---(this is correct)
Looking at the source code on the confirm.php page, I can see the hidden form elements have the newly discounted values spread out among all items rather than just taking the $1.80 off of the Dog Food's price.
The Discount Rule is like this:
"Number of items with a specific column value"
Number of items with Group of 10 > 0
"Based on session variable value"
If Session variable PromoCode == Food10
"Based on items with a specific value"
Total of TotalPrice where Group has a value of 10 times 0.10
How can I confine the discount to only the Dog Food items and leave the other prices at the full amount?
(Currently using eCart 5.0.7)