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

Last updated by Lauren 12 months ago.

Assigned support staff: Lauren.

Author Posts
October 10, 2018 at 9:14 am #2803588

Thomas

I am trying to translate a wocommerce product. I have set various custom fields from the theme to "translate" and they do show up in the woocommerce multilang translator. But when I enter translation in the second language and save then it is actually not saved. When I open the translation again the translated fields are empty again?

This is not the case for all the custom fields but only some liek all the product addons (field-product_addons-0-addons_label)

I have attached an image of the error I get when running the save action

Link to a page where the issue can be seen: hidden link

October 10, 2018 at 6:27 pm #2805420

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

Please check in your wp-content/themes/ directory and look in your theme folder. Do you see a file named wpml-config.xml there? It could be that these fields are predefined and the values are getting overwritten.

Also,I'm unable to see the full error. Perhaps you can copy and paste just one of the lines here, since it looks like many repeats of the same, or a similar, line. I also see a reference to job 20. If you go to WPML -> Translation Management -> Translation Jobs, if there is a job 20, please try canceling that job. Then, when you try to save the product translation again, do you see any errors in the browser console?

October 19, 2018 at 6:48 am #2830706

Thomas

Hi Lauren

directory does include a wpml-config.xml file but is has no mention of these fields.

Here is a a couple of full line of error code

[Wed Oct 10 10:03:39.221118 2018] [:error] [pid 19423:tid 140497179870976] [client 127.0.0.1:49927] FastCGI: server "/usr/lib/cgi-bin/php7-fcgi-nfk-nordiskfriluftskompani.dk" stderr: PHP message: PHP Warning: Invalid argument supplied for foreach() in /srv/www/nfk/nordiskfriluftskompani.dk/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php on line 556, referer: hidden link
[Wed Oct 10 10:03:39.221121 2018] [:error] [pid 19423:tid 140497179870976] [client 127.0.0.1:49927] FastCGI: server "/usr/lib/cgi-bin/php7-fcgi-nfk-nordiskfriluftskompani.dk" stderr: PHP message: PHP Warning: Invalid argument supplied for foreach() in /srv/www/nfk/nordiskfriluftskompani.dk/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php on line 568, referer: hidden link

I didn't find a translation job 20. I tried deleting other jobs but it did not help. Can I deactivate the translation manager completely? I find that function/service really annoying and over complicating things.

October 19, 2018 at 7:03 pm #2832863

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for the additional information. I assume you are setting the fields to translate in WPML -> Settings. The error message attached is directly related to custom fields. What happens if you try to set the fields to copy once? This should first copy the value from the original post to the translation. Then, see if you are able to translate the fields.

If that does not change anything, let me know and we can set up a clone of your site for further testing.

October 22, 2018 at 12:45 pm #2838074

Thomas

If i select "copy once" then the field(s) do not show up in the product translation editor.

October 22, 2018 at 4:05 pm #2838870

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

To best troubleshoot the issue, please make a snapshot of your site using the Duplicator plugin: https://wordpress.org/plugins/duplicator/. This will allow me to try and duplicate the error so that I can run further tests without interrupting your live site.

Once the snapshot is complete, either upload the snapshot ZIP file and the installer.php file to a file sharing service such as Dropbox (and share the link in your reply) or right click the Duplicator links in your wp-admin and paste in your reply.

Please note: It is important to reduce the size of the package so please exclude some paths like /cache or /uploads and also exclude archives and media files.

I will also need the username and password of an account that was created BEFORE creating the duplicator package.

I will enable the next reply to be private so only you and I have access to it!

October 23, 2018 at 4:12 pm #2843474

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks so much for sending the files. I was able to set up a copy of your site locally and test further. I found that the add on fields are stored in the post meta. This is the workaround that resolved the issue for me:

1. Go to WooCommerce -> WooCommerce Multilingual -> Settings. Switch to translate using the native WordPress editor instead of the Translation editor

2. When you go to translate a product, instead of clicking the "+" Icon, check the box to Duplicate, or click "Overwrite with Dutch Content". This will copy the post meta to the translated product.

3. Next, edit the translation and click "Translate Independently". Now you can click on the product Add Ons tab and add the translations.

Unfortunately, I could not resolve this issue using the translation editor to translate products. The issue seems to be that the theme you are using (since that is where the add-on fields come from, I believe) is not fully compatible with WPML. I also checked out list of compatible themes and I don't see your theme here: https://wpml.org/documentation/theme-compatibility/

We can suggest the theme author join our Go Global program so that he can work with our developers to make the theme fully compatible (https://wpml.org/documentation/theme-compatibility/go-global-program/)). In the meantime, I hope this workaround resolves the issue for you. Please let me know if you need any further assistance and I will be happy to help.