Change currency depending on visitor location

Your loop is coming from this code…

let currentPage=wixLocation.url;
let url=currentPage+ '?currency=EUR'   
wixLocation.to(url);

What you are doing here is grabbing the url that the visitor is currently sitting on, adding a parameter and then reloading the exact same page now with a parameter which is triggering the code to run again.

You will want to use this. queryParams - Velo API Reference - Wix.com

1 Like