Skip Navigation

[Resolved] Adding additional products to chinese cart makes first product revert to english

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 23 replies, has 2 voices.

Last updated by Shane 6 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#904344

Yes, of course. Go to the child theme, to this directory:

/wp-content/themes/yootheme-child/woocommerce/cart and open cart.php file

The code in the lines 88-97 was added to display the delivery times in days in the cart

When it comes to the name of the country, we didn't change anything as I remember (I'm not sure), but that code is in the same file on the lines 77-82.

I hope that I managed to help you with this information.

Best regards,

#905123

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jacques,

Just to confirm that this was custom code that was added right ?

I need to know so I can proceed, whether to escalate or debug further.

Thanks,
Shane

#905124

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Also on the backend,

Where is the delivery text defined. This helps me to trace and make a link and hopefully see why your text isn't being translated.

#905406

Yes, the code for the delivery in days is custom, but I think that the code for the country name isn't.
I altered the custom code based on the instructions from the WPML support in order to make it translatable.

It a mistake in that code?

Best regards,

#905649

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jacques,

I can trace and find out for you. But is the text written somewhere on the backend ? or in the code.

I know what line is used to display it as you sent but I need to know where the text is defined.

Thanks,
Shane

#906014

The used code only echoes the existing text, It is not written directly in the code in that php file.
This text is a variation description and I translated it in the Woocommerce multilingual in the backend.

Just go to Woocommerce > Woocommerce multilingual > Attributes tab > then select attribute: Target company country and region

I hope that this will save you some time.

Best regards,

#906300

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jacques,

So I dumped out the array .
<Code>
$product_item = $cart_item['data'];
var_dump($product_item);
[/php]

Turns out I do get the chinese texts sometimes. Well I noticed that after I refresh the page then I get the translated text. I'm investigating this further to see if WPML has a way to get the exact text because it should display correctly. All I see that you are doing is to just display the variation text in the cart.

I'm still able to debug this but my experience on WPML is really limited when it comes to debug WPML tasks.

Thanks,
Shane

#907133

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Escalated to WPML.

#1094103

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jacques,

Are you still experiencing this issue ?