WOOHOO THE BACKEND IS FINALLY ALIVE!!!!
i think i’ve done the hardest part of the project so far, actually finding out how to calculate the custom fees! (this include the handling fee from the courier, the possible duty rates if it exceeds the certain local thresholds, and the VAT of the country).
the way I’ve did this is thanks to the JSON list of countries I found earlier, i made another JSON list with every single country on my list (that has obtainable data), and in this list i compiled the VAT rate, the duty rates and thresholds, and the local handling fees. all of the information about the rates has been found thanks to Google Gemini, because finding exchange rates for like 194 countries wouldn’t have been coding and would have just been a waste of time. the data is quite pretty precise tho!
after that, the data is loaded into the browser and after all calculations, we come up to the conclusion of “total = VAT + duty fees (if applicable) + handling fees.”. this variable is then converted into the user’s country’s currency, and badaam done!
sorry for the long devlog, but a lot of stuff to say!
i also removed the origin country (which originally contained selectors for UK/US since stuff on flavortown can be shipped from UK), but turns out it does no difference, so I ended up removing it altogether.
and also did a couple of quick UI edits there and there, and yay!!!!