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

Last updated by linaD 2 months ago.

Assigned support staff: Raja Mohammed.

Author Posts
July 23, 2019 at 4:34 am #4262615

linaD

Hi Raja, any updates on this one ?

Moreover, not sure if this is related, but custom attribute translations are not being pulled to basket page also. Please see attached images, original and English translation where custom attributes are not translated (even thought they are actually translated with translation management tool you provide). Can you help me on this one or I should raise it as a new issue?

July 23, 2019 at 7:40 am #4263393

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi there,

Would you mind sharing temporary access to your site, This would be helpful for me to check a few parameters, I have enabled private fields for you to securely share the details.

Kind regards
Raja

July 24, 2019 at 10:23 am #4273075

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see an error in the cart page, which seems to be related to the attributes, Please share with us the server error logs, this can be obtained from your hosting provider, this will help us identify the root cause of the issue.

Warning: Invalid argument supplied for foreach() in /home/crshow/domains/craftshow.lt/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-attributes.php on line 411

you can paste your server error log to pastebin.com and provide me that link it would be great! (This is the cleanest way because sometimes the logs are long and create a complete mess in the discussion).

Kind regards
Raja

July 24, 2019 at 8:40 pm #4277507

linaD

Oh that's unfortunate. There is already ticket for that one: https://wpml.org/forums/topic/woocommerce-custom-product-attributes-gives-error-on-the-product-page/

If you read that ticket, you would see that this issue wasn't actually solved. But for some reason we were not able to replicate it after a while so it was marked as closed. Unfortunately I can't re-open that issue. Can you suggest anything?

I did some debugging and it's because "null" is passed to the foreach(), that's why it's showing that error. I feel like this ticket and the ticket that I've added in this message is actually the same thing eventually.

When writing my previous private reply I didn't had this issue as I did test it and that error wasn't appearing, but after posting the message here I did upgrade all my plugins (unfortunately I don't remember which ones as I did it in a bulk action). That's the only thing I can think of that actually caused this issue to reappear on the site.

I'm unable to get the server logs from my hosting provider at this moment. Would you be able to make a copy to a sandbox server and do the debugging part there ?

July 24, 2019 at 8:49 pm #4277527

linaD

I think I solved that error you've posted, products where not completely translated. So I finished translating them with Advanced Translation Editor tool and now it seems to be working fine. Can you have a look at my site now

July 25, 2019 at 7:04 am #4279681

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I can confirm the attribute values are translated in the cart,

However the attribute label is not translated yet,
To translate the attributes goto WooCommerce > WooCommerce Multilingual > Attributes
Select the attribute you want to translate, Scroll down to translate labels and slug. Here I see the attribute language is set to English but it has Lietuvos text,

I would suggest change the language of the attribute similar to the text and translate them.

I have added screenshots for your reference, I hope it can help you better,

Kind regards
Raja

July 25, 2019 at 8:23 pm #4285927

linaD

I'm afraid I'm back to the same issues and error. The attributes you are talking about are global ones and I've created them for other purposes. The problem is custom attributes.

I've removed all old products and global attributes so both of us can test from scratch. If I go to Marketplace section in the admin panel and create variable type product with custom attributes which are used as variations, then whenever I add that item to the basket I get the same error you've posted earlier. I've translated my two new products and it's still the same.

Custom attributes are not being pulled to Attributes section in the admin panel so there is nothing to translate there.

Honestly I don't know what actually "fixed" that error last time, but now I can always replicate it. Please try it yourself and create completely new product from scratch. As I've mentioned before, that error is because "null" is passed into the foreach()

For debugging purposes I'm sure you can modify that script which is giving an error and try-catch that error, then you can print the full stack trace. I'm pretty sure that's what you wanted to get from server error logs. I'm afraid I can't get access to the server logs in the nearest future

July 26, 2019 at 7:32 pm #4291591

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The issue seems to be any of your plugin or theme is conflicting with WPML,

Please perform basic diagnostic tests
- Deactivate all non-WPML plugins except WooCommerce, Check if the issue still persists.
- If the issue disappears try activating the plugin one by one to identify the conflicting plugin.

Share the results with me.

Kind regards
Raja

July 27, 2019 at 9:32 am #4293063

linaD

I have all my plugins turned off except:
WooCommerce
WooCommerce Multilingual (+ WPML Multilingual CMS, WPML String Translation, WPML Translation Management as these are required)

Once I turn on WooCommerce Multilingual error appears on the site so I think there is no clash between non-WPML and non-WooCommerce plugins. It must be something inside WooCommerce/WPML plugins itself.

July 29, 2019 at 5:43 am #4297093

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for the update.

Maybe the theme is conflicting, Please try changing the theme to any of WordPress default theme, Share the results with me

If the issue still persists, I would request you to share the snapshot (copy) of your site, you can use the Duplicator plugin to create a snapshot of the site and share the package link with me http://wordpress.org/plugins/duplicator/.

I have enabled private fields for you to securely share the details with you.

Kind regards
Raja

July 30, 2019 at 5:13 am #4304747

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for the details, I am working on this issue, I will keep you posted once I have something to share with you.

Kind regards
Raja

August 1, 2019 at 10:37 am #4320611

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for your patience,

I am able to see the translated attributes in the cart page in my local setup. I didn't modify or adjust anything so I could determine that the issue might be related to cache. Try clear the site and server cache. If you have server cache enable try cleaning them as well. check if the issue can be reproduced.

Kind regards
Raja

August 4, 2019 at 10:18 pm #4337031

linaD

Hi Raja.

Unfortunately I'm unable to fix my issue myself. I've cleared all the cache, disabled and eventually deleted all caching plugins. Still same issue. Would you be able to have a look at my site as you still have all the access + FTP details ?

August 5, 2019 at 9:30 am #4339319

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check with your hosting provider is there any server-side caching enabled? If so please ask to purge/clear the cache. Let me know the details.

I can try migrating your site to our private server to check for any server (cache) related issues. Let me know if that is okay I can send the migration instruction in my next response.

Kind regards
Raja

August 6, 2019 at 7:42 pm #4350193

linaD

I checked with my hosting providers, they assured there is no caching enabled that they are aware of. For the sake of curiosity, I used the same archive and installer I've provided you earlier on my localhost and I'm still able to replicate the same issue. See image attached.

I'm ok with you migrating my site to your private server. Let me know of the next steps I need to do.