ryanmitchell
Hi,
Now i getting the tax rate from each cart items. now have to calculate the tax amount from each item.
for example i have 3 items on cart like below object
{"items":[
{"name":"Item 1","qty":"1","price":480,"tax_rate":12,},
{"name":"Item 2","qty":"1","price":320,"tax_rate":5,},
{"name":"Item 3","qty":"1","price":440,"tax_rate":0,}
]
}
Sub total = 1240.00
Item 1 tax amount 480 * 12% = 57.60
Item 2 tax amount 320 * 5% = 16.00
Item 3 tax amount 440 * 0% = 0.00
Sum of Tax = 73.60
Cart Total = 1313.60
Have to calculate like above, but i have stuck.
Please help.
Thank you.