• Resolved saveatrain

    (@saveatrain)


    we have a light bug with your script.

    if you go to kideno.com/en/

    you have a search bar just at the top

    if you write bottles,

    look bellow the first result, it shows category in russian

    we have wpml on our site for english/hebrew/russian

    can you tell us whats wrong, or if its a bug on your end, fix it please?

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter saveatrain

    (@saveatrain)

    @marta ?

    Thread Starter saveatrain

    (@saveatrain)

    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

    Thread Starter saveatrain

    (@saveatrain)

    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

    Thread Starter saveatrain

    (@saveatrain)

    ?

    Plugin Author Damian Góra

    (@damian-gora)

    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.

    Thread Starter saveatrain

    (@saveatrain)

    Thread Starter saveatrain

    (@saveatrain)

    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

    Thread Starter saveatrain

    (@saveatrain)

    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.

    Thread Starter saveatrain

    (@saveatrain)

    hello?

    Plugin Author Damian Góra

    (@damian-gora)

    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.

    Thread Starter saveatrain

    (@saveatrain)

    i think its resolved,
    i went to the English kideno.com/en/ and searched bottle
    and now I see category in English
    thank you

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘category bug’ is closed to new replies.