Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was unable to see the IDs in the translation editor after following the instructions provided.

Solution:
1. We instructed the client to add the following code to their theme's

functions.php

file to enable the numbers to appear in the Advanced Translation Editor:

add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' );

2. We advised the client to set the "_pwgc_show_email_preview" custom field as 'Don't translate' and "_pwgc_email_design_ids" as 'Translate' in "WPML > Settings > Custom Field Translation".

3. We recommended making a small change in the default product and saving the changes, then retranslating the product. In the Translation Editor, the client should see the template ID selected for the default product and add the corresponding template ID for the translated product.

4. We provided a code change to be made in the

.../wp-content/plugins/pw-gift-cards/includes/class-wc-product-pw-gift-card.php

file, specifically to update line 172 from:

$original_product_id = icl_object_id( $this->get_id(), 'product', TRUE, $default_language );

to:

$original_product_id = apply_filters( 'wpml_object_id', $this->get_id(), 'product');

We also mentioned that our compatibility team will reach out to the plugin author for further steps since the solution worked in our sandbox environment.

If the solution provided is not relevant due to being outdated or not applicable to your case, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.

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

Last updated by Prosenjit Barman 1 year, 1 month ago.

Assisted by: Prosenjit Barman.

Author Posts
February 19, 2024 at 11:30 am #15317733

echtzeitG

Hello support-Team (Prosenjit),

because of being in holiday today I tried to follow the instruction in #15279488.

• I added add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' ); to the functions.php

• I set the _pwgc_show_email_preview" custom field as 'Don't translate' and Set "_pwgc_email_design_ids" as 'Translate

• I made small changes in the german main language and changed to the english translation

• but now I am stuck and can't see the IDs in the editor ...

Thank you for your help.
Best regards
Uwe

##########
Hello Uwe,
I hope you're doing well.

Our compatibility team has investigated and found a resolution for the problem. I have conducted tests in the Sandbox environment and can verify that the Gift Card template now appears correctly in each language.

Please try the following and let me know if you're getting the expected result or not.

- Please add the following code to the theme's functions.php file. It will enable the numbers to appear in the Advanced Translation Editor.
add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' );

- Once added, go to "WPML > Settings > Custom Field Translation" and set "_pwgc_show_email_preview" custom field as 'Don't translate' and Set "_pwgc_email_design_ids" as 'Translate'. [Click on the "Show System Field" link to see those fields]

- Make a small change in the default product and save your changes. Then, proceed to retranslate the product. During this process, in the Translation editor, you will be able to see the template ID selected for the default product. As a translation of the ID value, add the template ID you want to use for the translated product, corresponding to the selected checkbox. For instance, if the "Standard" Email template was chosen for the default products, positioned first, its ID would be '0'. To assign the "Standard EN" template to the translated product, positioned seventh, use the ID '6'. When accessing "Email Designer" via 'Pimwick Plugins', the arrangement of Email templates reflects their respective IDs.

- Once the translation is completed, open .../wp-content/plugins/pw-gift-cards/includes/class-wc-product-pw-gift-card.php file and Look for line 172.

Change it from:

$original_product_id = icl_object_id( $this->get_id(), 'product', TRUE, $default_language );

To:

$original_product_id = apply_filters( 'wpml_object_id', $this->get_id(), 'product');

As you can see, there is not a simple workaround and the author already has some old integration code.

Since the solution worked in our sandbox, our compatibility team will reach out to the plugin author to take the next steps.

Please let me know the results. If you need further assistance or clarification in any particular steps, please feel free to let me know. I will be happy to help.

Best Regards,
Prosenjit

Bildschirmfoto 2024-02-19 um 12.24.39.png
February 20, 2024 at 11:12 am #15322151

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi Uwe,
I hope you're doing well.

I understand the issue. Upon reviewing the WPML Debug Information, I noticed that the WPML, String Translation, and WooCommerce Multilingual plugins haven't been updated to their latest version. I recommend updating these plugins to their most recent versions as a first step.

Regarding the code you've implemented in the functions.php file, it's designed to enable the translation of numerical values through WPML's Advanced Translation Editor. To utilize this feature for translating IDs, please ensure that the 'Advanced Translation Editor' is selected as your preferred "Translation Editor" in the "WPML > Settings" menu.

If the Advanced Translation Editor is already chosen, make sure to opt for the WPML Translation Editor when initiating the translation process. For guidance, you can refer to this screenshot: hidden link.

If you have previously translated products into other languages, it's advisable to delete those translations (ensuring they're also removed from the Trash) and then re-translate the products using the WPML Translation Editor for the changes to take effect properly.

Please check and let me know the update. If you need further assistance, I will be happy to help.

Best regards,
Prosenjit

February 21, 2024 at 1:06 pm #15328077

echtzeitG

Hi Prosenjit,

I tried all the things you wrote me, but I'm still stuck.

• I updated all plugins
• I deleted the EN-Version of the product and created a new one by duplication and editing

Thank you for your help

Uwe

Bildschirmfoto 2024-02-21 um 12.56.19.png
Bildschirmfoto 2024-02-21 um 13.03.15.png
Bildschirmfoto 2024-02-21 um 13.03.49.png
February 22, 2024 at 5:53 am #15331096

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello Uwe,
Thank you for the update.

Since the issue persists despite following the steps, a closer inspection will be required to understand the root cause of the issue.

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.

You will find the needed fields below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT
-Please backup site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Looking forward to your response.

Best Regards,
Prosenjit

February 23, 2024 at 10:33 am #15337046

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello Uwe,
Thank you for sharing the access information.

I've checked and can confirm that the setting was made correctly there. To locate the ID in the Translation Editor, you simply need to search for it. For instance, to find the ID for the "Geschenkgutschein" Email template, which is 0, you just need to input 0 into the search field within the Translation Editor, and the ID will be displayed for translation. Please check this video(hidden link) to get a better understanding of the process.

Once you've translated the ID, proceed to make the other adjustments (such as updating the code) and I hope the issue will be solved right after that.

But, feel free to let me know if you need further assistance. I will be happy to help.

Best regards,
Prosenjit

February 23, 2024 at 11:12 am #15337250
echtzeitG

Hi Prosenjit,

I think I understand now what to do –
but now I have a new issue:
What do I have to do in this window?
I get an error (see top right)
Thank you for your patience!

Best regards
Uwe

New threads created by Prosenjit Barman and linked to this one are listed below:

https://wpml.org/forums/topic/split-translator-error-while-trying-to-translate/

Bildschirmfoto-2024-02-23-um-11.56.30.jpg
February 26, 2024 at 6:11 am #15342238

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello Uwe,
I hope you're doing well. Sorry for the delay in responding due to the weekend.

Glad to hear that you understood the process.

To maintain clarity and organization in each thread, we are allowed to discuss one issue per ticket. Since the issue you raised in the last response is different than the issue initially reported in this ticket, I created a new ticket for you to address the issue separately. A response will be sent to that ticket shortly.

I hope you can understand. Let's continue the discussion about displaying the translated gift card within this specific ticket. If you need further assistance, please feel free to let me know. I will be happy to help.

Best regards,
Prosenjit

March 7, 2024 at 5:26 am #15382189

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

[Removed by the Internal System]