Support » Plugin: Trusted Shops Easy Integration for WooCommerce » Multilanguage sites with WPML and shortcodes?
Multilanguage sites with WPML and shortcodes?
-
Hi,
I have a multilingual site so I need to put a different ID for each page / language of my widget.
WPML doesn’t allow to modify the shortcode code since it’s not a text to translate.
So how can I do this then?Thank you,
-
Hi there,
which shortcode are you talking about exactly? Where did you place them? Translating a page/post should result in a possibility to add a different shortcode to that translated content too.
Cheers
Hi,
Thank you for your quick answer.
Shortcode of widget reviews. I placed it in an elementor template page.In WPML translator I have this: https://gyazo.com/07776d91abb3284dc839705059dcafd7
It doesn’t allow me to translate the actual ID. I opened ticket with WPML to know more.Thank you
Hi there,
that’s a very special case I guess 🙂 Building multilingual elementor templates with WPML – I guess this usecase may only be supported in case WPML allows these custom fields to be translatable.
Best
Elementor template pages are very common in wordpress developement nowdays. 🙂
And I’m not sure it’s actually related at all. It’s strcitly related to WPML and shortcodes I believe.
And I’m not sure it’s actually related at all. It’s strcitly related to WPML and shortcodes I believe.
Well it is related as these templates need to be translatable via WPML and that is a functionality only WPML can provide. You could integrate/implement a custom shortcode and check the current language via PHP and place/provide the actual widget as needed. But that requires a custom implementation.
It looks like the plugin need a configuration file for WPML.
Please read the ticket I opened here: https://wpml.org/forums/topic/shortcode-translation/And the configuration is described there: https://wpml.org/documentation/support/language-configuration-files/#1-4-automatically-converting-shortcode-ids
Can you please have a look and advise?
Thank you,
Hi there,
the automatic translation won’t work, as the id attribute does not contain posts/pages but the TS widget id. I’ve added a wpml-config.xml to our dev environment:
<wpml-config> <shortcodes> <shortcode> <tag>ts_widget</tag> <attributes> <attribute>id</attribute> <attribute>sales_channel</attribute> </attributes> </shortcode> </shortcodes> </wpml-config>
You may add the file manually to
wp-content/plugins/trusted-shops-easy-integration-for-woocommerce/wpml-config.xml
and disable/re-enable the plugin. Does that work?Cheers
This doesn’t seem to work as it seems to add the ID and not replace it once I translate it.
Also I’m facing another issue, the widget ID of another language/chanel is not working. Nothing is returned. It’s blank.
It’s impossible to debug because there is no error messageHi there,
This doesn’t seem to work as it seems to add the ID and not replace it once I translate it.
Hm, I don’t know how it should work but I guess the ID should be translatable? At least that’s what the docs say: https://wpml.org/documentation/support/language-configuration-files/#page-builder-content
Also I’m facing another issue, the widget ID of another language/chanel is not working.
You may check that by using the built-in functionality to place widgets for different sales channels (languages) via the GUI and compare the embedded code. Please check your Chrome dev tools for details.
That’s another thing I don’t understand about the “Location” dropdown. If I select “homepage” how does he know where to show the widget? For example the carousel.
Same for footer/header I’m not quiet sure.Thank you
Hi there,
please contact the TS support on details about the locations. The plugin uses Hooks provided by WooCommerce (and your theme) to place the widgets. In case of the homepage, the
woocommerce_after_main_content
is used and an additional check viais_shop()
is made to check whether it’s the shop main page (product archive or shop page).Cheers
-
This reply was modified 6 months ago by
vendidero.
In that case this is not working as no widget is showing up at all with these locations. So I’m not able to debug anything and understand why the other channel is not showing up.
Are you able to look this up? Thank you
Hi there,
than you might do as follows: Disable all plugins but Woo and the TS plugin and activate a default theme (e.g. TwentyX, Storefront). Please disable adblockers in your browser too to make sure requests are not blocked. Please use the chrome dev tools to check whether the scripts/snippets are embedded.
Cheers
Hi
So I enabled only Woocommerce, WPML, default storefront theme and the plugin.
I can now see the TS tab in product page with the carousel widget for one channel but the issue persist in the other language. It’s blank
And nothing in console dev to understand anything.
Let me know where I can send you the URL in private?
By default, the widget will only show in the language configured. For each language available in WPML you’ll find a separate channel in the GUI – did you configure the widgets for the other language(s) too?
Maybe linking some screenshots of your configuration would help.
-
This reply was modified 6 months ago by
- The topic ‘Multilanguage sites with WPML and shortcodes?’ is closed to new replies.