I am creating an ecommerce system where i would need to calculate taxes for diffrent countries during checkout. I have added a flat rate for the tax, but that is not how tax works, it need to be percentage based which i have done, but how do i know the country a user is about to order a product from and also get the tax amount for that country and do my basic calculation.
please if you have done this before i would really appreciate any help as that would help me fix this issue.
Right now, this is how i am performing the tax calculation with a fixed percentage for all users from all countries
def cart(request):
new_tax_amount = 0
tax_amount_by_percentage = 25 / 100 # 25% / 100 = 0.25
new_tax_amount += int(item['qty']) * float(tax_amount_by_percentage )
This works well for me, but i need to know how to get tax percentage based on the country the user is trying to order the product from, then do my