This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by Bruno 1 year ago.

Assigned support staff: Bruno.

Author Posts
September 20, 2018 at 2:25 pm #2752444

Thibaut

Hello,

I need to make WooCommerce multilingual assets to load only when viewing shop pages.
How can I do that?

September 21, 2018 at 2:58 pm #2755632

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for contacting us. I do not think this is possible unless you use custom coding to unregister and then re-register the assets.

The WPML loads these assets into the front end so you can use the currency selector, as well as other scripts that may be needed, such as cart widget (if necessary).

These default assets are defined in the file woocommerce-multilingual/inc/class-wcml-resources.php on line 139.

To change this you can use the WordPress documentation:
https://codex.wordpress.org/Function_Reference/wp_deregister_style
https://codex.wordpress.org/Function_Reference/wp_deregister_script

And then, register these assets as you wish. As this is a custom feature, unfortunately, this is beyond the scope of our support.

We have a list of WPML and WooCommerce Multilingual hooks that can help you develop such feature, which can be seen in the links below:

- https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference
- https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

If you prefer, you can contact one of our certified partners who can develop small to large features for your site: http://wpml.org/documentation/support/wpml-contractors/

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.

September 25, 2018 at 8:08 am #2762915

Thibaut

Hello,

Of course it requires custom code and using hooks. I hoped you'd be able to provide me with a quick solution using hooks, as you know 100% of the WPML code and it would have been very easy for you.

Strange support for your customers having a paid license... ?
Anyway, I guess I'll look for help elsewhere.

September 26, 2018 at 7:47 am #2766237

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thanks for the feedback. Unfortunately, since this requires custom coding, this is beyond the scope of our support.

You can see our support policy: https://wpml.org/purchase/support-policy/. The links I posted above should help you develop a customized solution for your needs.

Please, note that if you try to do the custom code and have any questions, we can help with some ideas about the code.

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.