Shortcode [currency_switcher] doesn’t work
-
I am doing local development using bricks builder. I tried to insert this shortcode into header, and it’s not rendered.
Please check this link: https://www.loom.com/share/2e7a59e7d6da472896269505d1b247e8?sid=cfb02543-d86f-4fd9-b634-3fe92515fc35
-
Hello @breadf,
If you added into a native WordPress widget or using a different theme does it work? This will let us know if the problem is related to Bricks theme or if something else is happening in your website.
Also, have you tried any other of the options available in WooCommerce > WooCommerce Multilingual >Multicurrency?
Yes I tried. It doesn’t work.
I tried to get a custom code from Chatgpt as below and it doesn’t work as well:function custom_wpml_currency_switcher_shortcode() {
if (function_exists(‘wpml_currency_switcher’)) {
ob_start();
wpml_currency_switcher([
‘switcher_style’ => ‘dropdown’ // Adjust based on your WPML backend setting, if necessary.
]);
return ob_get_clean();
}
return ”;
}
add_shortcode(‘wpml_currency’, ‘custom_wpml_currency_switcher_shortcode’);I created the following Sandbox and added a
[currency_switcher]shortcode in Appearance > Customize > Widgets and it is working correctly. Could you try something similar in your website?Otherwise, could you please try to add your currency switcher in the same Sandbox? In that way, we will be able to investigate it further.
In this case, it may be related to Bricks Builder.
@breadf I have removed your offer to send login credentials, please never do that again, even for staging sites.
Common reasons for edits or suspensions include but are not limited to: […] Posting or accepting offers or requests for login information to a site.
https://ww.wp.xz.cn/support/guidelines/#we-reserve-the-right-to-manage-the-forums-to-the-best-of-our-abilityOh sorry, I am not aware of this rule. Thanks for telling me this.
I’m afraid it is also working with Bricks, I created a new page and added the shortcode there and it is working fine.
In that case, it could be either the theme, plugin or a combination of both. Therefore can you do the following: check if this issue appears in your test site when:
- Only WCML plugin is activated, as it will tell us if there is an interaction issue with other plugin.
- Theme is set to a WordPress default like Twenty Nineteen as it will tell us if there is an interaction issue with your theme
If you don’t see the issue happening in the above scenario, can you try to determine whether this is a theme or a plugin issue?
I tried again and deactivated all plugins except woocommerce: