Javascript Code to change the currency of the website

Job ID: 34278011

Budget: $10 – $30 USD

Write Javascript code to achieve the following function (we will add the code to our website https://t1.mydesignlist.com to test it):

If the URL has a currency parameter like currency=currency_code and
if the website has this currency and
if the currency code of the current currency is not currency_code, then change the currency of the website to the currency, which the currency code is currency_code,


Case 1:
if the URL is like the following:
https://t1.mydesignlist.com/custom-phone-cases.html

Then do nothing, because it has no currency parameter like currency=currency_code

Case 2:
if the URL is like the following:
https://t1.mydesignlist.com/custom-phone-cases.html?currency=JPY

Then do nothing, because the website has no currency JPY


Case 3:
if the URL is like the following:
https://t1.mydesignlist.com/custom-phone-cases.html?currency=USD

and the current currency is USD, then do nothing


Case 4:
if the URL is like the following:
https://t1.mydesignlist.com/custom-phone-cases.html?currency=EUR

and the current currency is USD, then change the currency of the website to EUR
Related categories: JavaScript AJAX jQuery / Prototype