can you please try to see the problem I am facing?
Plugin Support
Marta
(@martadella)
Hi @saveatrain,
Perhaps the relationships between the products and the categories are broken. Could you save the broken category via the WPML Taxonomy translation module: https://ibb.co/cJqpm6f?
Please let me know how it goes!
Regards,
Marta
i went into taxonomy on wpml and it says all is synced
I can give you admin access to check this further, and I would appreciate if you do
Hi @saveatrain,
It’s a public forum. Don’t share any sensitive data here!
I couldn’t recreate your issue on the blank Woo + WPML environment, so I guess this issue is specific.
It seems that your EN category “nursing> Bottles” has set RU translation as a parent “уход> Бутылки”. It’s a wrong relationship, and it requires fixing it in the database.
I recommend contacting WPML support. Maybe they have some tools to check and fix taxonomy relationships.
ok wpml found the issue
https://cdn.wpml.org/wp-content/uploads/2021/11/9944295-DiffSourcELANGS.png
you take the category name based on the master name, but in some cases the master name is english or russian or hebrew.
instead you should take the category name, based on the hreflang of that page
i stressed the question to them and here is the answer:
1. You wrote: ” I can tell them that instead of taking the master category, they should take the language-relevant category”
Short answer is “yes” – we set language cookies for the “active session language” which is what they should be using and probably are. Recall that they did test their plugin on a fresh installation and all works as expected.
If you can’t fix wrong relationships in a icl_translations table, try the following code.
add_filter( 'dgwt/wcas/multilingual/term', function ( $term, $term_id, $taxonomy, $lang ) {
if ( $taxonomy === 'product_cat' ) {
$current_lang = apply_filters( 'wpml_current_language', null );
if ( $lang !== $current_lang ) {
// Get term without switching language to wrong term language. Force hreflang
$term = get_term( $term_id, $taxonomy );
}
}
return $term;
}, 10, 4);
It should force hreflang instead of taking a language code from the WPML icl_translations table.
You have two ways to add this code to your theme:
1. Open the functions.php in your Child Theme and add the code at the end
2. or install the Code Snippets plugin and apply this code as a snippet
Let me know if it helped.
i think its resolved,
i went to the English kideno.com/en/ and searched bottle
and now I see category in English
thank you