Skip Navigation

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

Problem:
The client is experiencing an issue with missing information in the product view, which seems to be related to a translation problem. The error message indicates an 'Invalid taxonomy' when trying to retrieve terms using custom code.

Solution:
We have identified that the issue is with custom code attempting to access a taxonomy with an incorrect slug. The correct code should use the taxonomy slug 'gebinde_de' instead of 'gebinde'. Here are the steps to correct the issue:

$the_id = get_the_ID();<br />$categories = get_the_terms( $the_id, 'gebinde_de', array( 'order' => 'DESC') );

We recommend updating the custom code in the file

/wp-content/themes/rttheme19/product-contents/single-products-content.php

on lines 322-323 with the correct taxonomy slug. If the client's developer is unable to resolve the issue, we suggest contacting one of our certified partners for further assistance.

If this solution doesn't look relevant, 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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Long Nguyen 1 year, 2 months ago.

Assisted by: Long Nguyen.

Author Posts
November 27, 2023 at 1:09 pm #14930363

thomasS-239

I had already opened a ticket about this problem, but it was closed again because I was ill for a long time.
We have a big problem with the product view. Very important information is missing there. The fact that these are missing must have something to do with the translation.

The product view programmer sent us the following error message:

The Gebinge graphics etc are output if the "terms":

$categories = get_the_terms( $the_id, 'bin', array( 'order' => 'DESC') );
$terms = $categories;
are not empty and do not produce an error. But this is what they do:

object(WP_Error)#32324 (3) { ["errors"]=> array(1) { ["invalid_taxonomy"]=> array(1) { [0]=> string(21) "Invalid taxonomy." } } ["error_data"]=> array(0) { } ["additional_data":protected]=> array(0) { } }

Where is the error in the translations and how do we fix it quickly?

Please provide urgent feedback.

Many thanks
Daniela Ruhnau

Screen-JB-product.png
November 28, 2023 at 5:09 am #14935683

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Thomas,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

According to your screenshot, I see the image icons are not displayed on the product page in German language, not a translation product page. So I think it might not related to WPML.
If you deactivate WPML plugin, are image icons displayed properly on your site?
❌ IMPORTANT: Please backup your database and website before proceeding ❌

Look forward to your reply.
Thanks

November 28, 2023 at 8:29 am #14936507

thomasS-239

Hi,

thank you for the feedback.
Not only are the symbols missing, but the entire block.
If I deactivate WPML the product page no longer opens at all. So it must be related to WPML.
Could it be the string translation?
It is really very important that this block appears again and the error message in question is turned off.

Many thanks
Daniela Ruhnau

November 28, 2023 at 9:48 am #14937219

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Let me know how to replicate the issue on your site. Then 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. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Look forward to your reply.
Thanks

November 29, 2023 at 3:06 am #14945785

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

After investigating the issue further, I see that it is a custom code, not the standard code of the theme itself. The code is located in the file /wp-content/themes/rttheme19/product-contents/single-products-content.php line 322-323

$the_id = get_the_ID();
$categories = get_the_terms( $the_id, 'gebinde', array( 'order' => 'DESC') );

as you can see, the developer is trying to get the term ID of the taxonomy "gebinde" but the slug of this taxonomy is "gebinde_de". You can see it in Pods Admin > Edit Pods. I correct the taxonomy slug in the code and the section displayed as well in the front end. Please check screenshot attached.

I would like to inform you that helping you with custom code further, is out of the scope of WPML, but I helped you a lot, pointing you to the source of the problem you are having.
If your developer is not able to fix the issue, I would recommend you contact one of our certified partners who will be more than happy to help you with this. In this link, you will find a list of our certified partners: https://wpml.org/contractors/

Thanks.

Super Motorenöl ÖKO Gas-LPG – JB GERMANOIL 2023-11-29 10-04-16.png
Edit Pods ‹ JB GERMANOIL — WordPress 2023-11-29 10-02-24.png
November 29, 2023 at 8:22 am #14946945

thomasS-239

thank you very much, you helped me a lot. This solved the problem. So Many thanks.
Best regards
Daniela Ruhnau

November 29, 2023 at 10:10 am #14948535

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Feel free to contact us again if you have any questions.

Thanks and have a good day.