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 4 replies, has 2 voices.

Last updated by thomasK-90 3 weeks, 6 days ago.

Assigned support staff: Laura.

Author Posts
September 16, 2019 at 9:23 am

thomasK-90

I use Japanized for WooCommerce. I only want to use the function of this plugin for Japanese language. So until recently I was limiting the function of it by adding
if( ICL_LANGUAGE_CODE != ‘ja’ ) return;
in
woocommerce-for-japan.php

as follows.
public function __construct() {
//WPML check
if( ICL_LANGUAGE_CODE != ‘ja’ ) return;

However, it seems now this method is not working. I contacted the plugin developer as well but so far no reply.
Could you help me??

September 16, 2019 at 11:20 am
September 17, 2019 at 11:54 am #4588229

Laura
Supporter

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

Timezone: Europe/Rome (GMT+02:00)

Hi,

from 2nd tier suggest replacing on woocommerce-for-japan.php line 256

JP4WC::instance()->init();

with

if (apply_filters( 'wpml_current_language', NULL ) == 'ja') {
JP4WC::instance()->init();
}

If still doesn't work, please check if

var_dump(apply_filters( 'wpml_current_language', NULL ) == 'ja'); 

returns true or not.

September 17, 2019 at 4:47 pm #4590309

thomasK-90

When I replace with the code you suggest, the page gives an error saying

The site is experiencing technical difficulties.

And where should I put the 2nd line?

September 17, 2019 at 5:19 pm #4590371

thomasK-90

My issue is resolved now.
Sorry for the message before. I have copied the code from the email and therefore was encoded wrong. Now I copied from this page and it worked!
Thank you!

September 18, 2019 at 4:07 pm #4598641

thomasK-90

Is there a was to make this work in functions.php instead of every time I update this file?