Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,
    You can style the currency switcher to any style that you want by visiting the multicurrency settings page in WooCommerce > WooCommerce Multilingual > Multicurrency
    There you can edit the currency switcher and change its style. By default it is set to dropdown on hover.
    Furthermore you can read our document here about creating a custom template for your currency switcher: https://wpml.org/documentation/related-projects/woocommerce-multilingual/designing-custom-currency-switchers-using-template-files/

    I hope that this helps you.

    Thread Starter napisal

    (@napisal)

    Thank you. I’ve managed to deal with most of the problems using CSS, still, two things are unsolved:

    1. https://ambery.net – first dropdown currency menu item has 1px smaller width than others. Couldn’t find the reason in CSS.
    2. Switcher fades away from menu when screen is smaller and other CSS rules are activated. Previous version worked well, it stated to hide in mobile version only after plugin update.

    I am unable to locate the source of the problem. Also it looks like the menu item is less than 1px smaller.
    As far as I see, there is only one currency switcher and it is being hidden when you resize the browser past certain dimensions. This however all seems to me like something coming from the theme and I am unable to help you with these issues. If you think that the current currency switcher styling is to blame, perhaps you should use the link that I provided above and create a custom template for the language switcher so that it is unaffected by any CSS

    Thread Starter napisal

    (@napisal)

    Thank you! I’ve created folders and files in my child theme (/wpml/templates/currency-switchers/ambery) to try customising my own template, but I couldn’t find a way to activate it. All files are there, still default one is activated.

    Thread Starter napisal

    (@napisal)

    I assume the template has to be chosen inside WooCommerce Multilingual settings, however, this setting it’s not there.

    Also, the only place where I can now change currency list style is inside the Product page Currency Switcher settings. When I switch “Show a currency selector on the product page template” off, currency switcher transforms from dropdown to horizontal list.

    Currency switcher options contains only currency ordering and Additional CSS field.

    Again, everything was just fine before the update.

    I guess you have a custom currency switcher then perhaps?
    Maybe you are using our api:
    do_action('wcml_currency_switcher');
    ?
    If this is true, you can pass parameter to this and specify the template name.
    For example:
    do_action('currency_switcher', array('format' => '%code% %symbol%', 'switcher_style' => 'wcml-vertical-list'));
    You can replace wcml-vertical-list with your template name there.

    If this is not the case – then please either provide the complete code that you are using, or open a ticket at our forum at wpml.org so that we can investigate.

    Thread Starter napisal

    (@napisal)

    I was using a shortcode [currency_switcher] inside the menu with special plugin.

    But I just changed the integration, it is now like that in functions.php:

    /* Add currency switcher to top bar menu ========== */
    add_filter(‘wp_nav_menu_items’,’add_search_box_to_menu’, 10, 2);
    function add_search_box_to_menu( $items, $args ) {
    if( $args->theme_location == ‘top-bar-menu’ )
    do_action(‘wcml_currency_switcher’, array(‘format’ => ‘%code%’, ‘switcher_style’ => ‘wcml-dropdown’));
    return $items;
    }

    When trying to change ‘wcml-dropdown’ to my template name (‘ambery’), frontend shows blank page only (even when debug mode is on). Also, when using ‘wcml-dropdown’, plugin still shows a vertical list. It becomes dropdown only when turning on “Show a currency selector on the product page template” in Multi-currency Settings.

    Are you using the same quote characters?

    Also, in order to use the switcher_style you need to specify the proper slug of the template. Usually you specify the slug in the config.json file, but if not specified, then an auto-generated slug is created.
    In example for Twenty Seventeen, the slug for your template would be ‘twenty-seventeen-ambery’

    Thread Starter napisal

    (@napisal)

    Thank you! I’ve made one custom theme for desktop and now making other one for mobile. Seems working fine!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Old style Currency Switcher’ is closed to new replies.