• Resolved jacquestk

    (@jacquestk)


    Hello,

    the plugin works perfectly on my site, however i’m not able to add currency links in the header section of the homepage following your instructions provided here: http://currency-switcher.com/how-to-create-currency-links-without-shortcode/

    I dropped the currency links in a text widget and placed it in the top bar area. Then I pasted the js code into a custom .js file and added it using wp_enqueue_script() in my theme’s function.php file.

    The links show up as expected and the script loads properly. However nothing happens when i click on the currency links.

    I’m not sure what i’m doing wrong. can you help me to fix it?
    Alternatively is a shortcode available with currency links instead of a dropdown list?

    Thank you,
    jacques

    https://wordpress.org/plugins/woocommerce-currency-switcher/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author RealMag777

    (@realmag777)

    Hello Jacques

    Currencies links is just link like:
    * http://demo.currency-switcher.com/?currency=USD
    * http://demo.currency-switcher.com/?currency=GBP

    For example drop usual text widget and write there HTML code:
    <a href="/?currency=USD">USD</a>&nbsp;<a href="/?currency=GBP">GBP</a>
    +
    You can set view of switcher as flags http://clip2net.com/s/3vRfHhO and just drop in the same text widget usual shortcode [woocs]

    Thread Starter jacquestk

    (@jacquestk)

    Thanks a lot for your feedback.

    The links do change the currency, but they take me back to the homepage.
    I would like to be able to change the currency while staying on the current page.

    The shortcode [woocs] does just that, but for aesthetic reasons i would like to display the switcher as text links instead of flags or dropdown.
    How can i generate links that grab the current address and amend e.g. “/?currency=GBP” ?

    Thanks

    Plugin Author RealMag777

    (@realmag777)

    Hello

    In such case enable flags view and make customization here:
    * wp-content\plugins\woocommerce-currency-switcher\views\shortcodes\woocs.php
    * replace

    if ($drop_down_view == 'flags')
    {
        foreach ($this->get_currencies() as $key => $currency)
        {
            if (!empty($currency['flag']))
            {
                ?>
                <a href="#" class="woocs_flag_view_item <?php if ($this->current_currency == $key): ?>woocs_flag_view_item_current<?php endif; ?>" data-currency="<?php echo $currency['name'] ?>" title="<?php echo $currency['name'] . ', ' . $currency['symbol'] . ' ' . $currency['description'] ?>">
                    <img src="<?php echo $currency['flag'] ?>" alt="<?php echo $currency['name'] . ', ' . $currency['symbol'] ?>" />
                </a>
                <?php
            }
        }
    }

    to

    if ($drop_down_view == 'flags')
    {
        foreach ($this->get_currencies() as $key => $currency)
        {
            if (!empty($currency['flag']))
            {
                ?>
                <a href="#" class="woocs_flag_view_item <?php if ($this->current_currency == $key): ?>woocs_flag_view_item_current<?php endif; ?>" data-currency="<?php echo $currency['name'] ?>" title="<?php echo $currency['name'] . ', ' . $currency['symbol'] . ' ' . $currency['description'] ?>">
                    <?php echo $currency['name'] ?>
                </a>
                <?php
            }
        }
    }
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘currency links not working’ is closed to new replies.