Streaming live at 10am (PST)

Integrating code into CSS classes?

Hey all!
A friend has written some geo-autocurrency code which works very nicely, but is completely vanilla.
I would like to integrate it into my WebFlow site (exported) without having to shoe-horn it in each time I update and export the site.

I’m sorry for the crappy title, but I have no idea how to even label this request/function.

The desired end result: I have pricing on the Pricing page of my website, shown in British Pounds (£). I would like to automatically show another currency when the user is outside of the UK. As mentioned, the functionality for this script is already developed, I just need to know how to integrate it into my site.

Site is live here:
Same site on WF:
Read-only link:

Any help would be greatly appreciated! And if it’s quite involved, happy to send a little cash to someone for the help.



        .FXhidden {
            display: none;

        .FXshown {
            display: inline-block;

    <script src=""
        integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>

        $.getJSON('', function (data) {
            var country =;
            var continent = data.continent;
            // not needed for the real script, just to show the result in the body
            document.getElementById("country").innerHTML = "<b>" + country + "</b>"
            document.getElementById("continent").innerHTML = "<b>" + continent + "</b>"
            switch (true) {
//                case (country == "United Kingdom"):
//                    newCur = "GBP"
//                    newCurSymbol = "£"
//                    break;
                case (continent == "Europe"):
                    newCur = "EUR"
                    newCurSymbol = "€"
                case (country == "United States"):
                    newCur = "USD"
                    newCurSymbol = "$"
//                default:
//                    newCur = "GBP"
//                    newCurSymbol = "£"
            if (newCur != "GBR") {
                    // this makes the $.getJSON call synchronous so we get an answer before continuing
                    async: false
                t = $.getJSON('' + newCur, function (data) {
                    // get the valud for selected currency and return that from the script
                    return data.rates[newCur]
                factor = t.responseJSON.rates[newCur]  // could maybe multiply by 1.05 to add 5% 'fudge'
            } else {
                factor = 1 // as there's no fudging needed for the UK
            // loop through each 'ukprice' named object, and apply the factor and currency symbol...
            $('[name=ukprice]').each(function (index) {
                oldPrice = this.innerText
                this.innerText = newCurSymbol + Math.ceil(oldPrice * factor) 
                this.classList = "FXshown"




    <p>The script has two styles - <i>FXhidden</i> and <i>FXshown</i>. Initially the values are set to <i>FXhidden</i> during
    <p>The script leverages jQuery (already present in the PuzzleFactory template, so no additional overhead).</p>
    <p>This makes a single call to which gets the country name. allows up to 1000 calls/day for
        free. This call also takes about .3s. The country located is: <span id="country">Checking...</span> in <span
    <p>The returned value is then used to determine which currency conversion we need (USD or EUR), which then calls</p>
    <p>Once we have a conversion factor, then the calculation is performed, the correct currency symbol inserted, the
        text updated and finally the class set to <i>FXshown</i></p>
    <p>Potentially, the time for these calls could be reduced by storing a cookie for a user (under <a
            href="">ePR</a> that might not require
        consent, but those rules are not in place yet). We could also embed the API call in the underlying PHP code
        itself (if that can be changed) as well as only do the currency rate look up (say) daily.</p>

    <p>Item One Price: <span class="FXhidden" name="ukprice">10.50</span></p>
    <p>Item Two Price: <span class="FXhidden" name="ukprice">11.75</span></p>
    <p>Item Three Price: <span class="FXhidden" name="ukprice">543.21</span></p>



Rename post bump. Hopefully this is clearer?

@Admin @mods Please delete this thread.