Skip to content

Instantly share code, notes, and snippets.

@bunnywong
Created March 21, 2015 19:21
Show Gist options
  • Save bunnywong/c36ff7e04f45960d1d89 to your computer and use it in GitHub Desktop.
Save bunnywong/c36ff7e04f45960d1d89 to your computer and use it in GitHub Desktop.
Opencart - Less reward by coupon used
DS15030247
Coupon value: $12.7
Total price(exclude shipping): $127
Sys reward: 89 + 16 = 105 (less )
Collect reward: $127 - $12.7 = 114.3
Products qty:
10 + 1pcs
(RA)reward adjustment of coupon
$12.7 / 11 = 1.15
Machine calc
a) 10pcs * $10 - 1.15(RA) * 10
= 100 - 11.5
= 88.5
= 89(round up)
b) 1pc * $27 - 1.15(RA)
= 27 - 1.15
= 25.85
= 26(round up)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment