Support » Plugin: Woocommerce Polylang Integration » not able to translate product category

  • Resolved daining1298

    (@daining1298)


    I am using wordpress 5.1.1. But for product it is ok to create a translate. but not able to translate it category. I need to add translated product to its category in its own language.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Darko G.

    (@darkog)

    Did you enabled the Product Category from Polylang settings? https://prnt.sc/nqipre

    To reply myself, this thread solves the problem.
    https://wordpress.org/support/topic/flags-not-appear-on-dashboard/

    buutqn

    (@buutqn)

    I’ve faced a problem: Translate the product category breadcrumbs.

    This is how i’ve solved this:

    add_filter("woocommerce_breadcrumb_main_term", "theme_woocommerce_breadcrumb_main_term", 11, 2);
    
    function theme_woocommerce_breadcrumb_main_term($main, $terms) {
        $current_lang = pll_current_language();
        if ($current_lang) {
            foreach ($terms as $term) {
                $term_id = $term->term_id;
                $lang = pll_get_term_language($term_id);
                if ($lang === $current_lang) {
                    $main = $term;
                    break;
                }
            }
        }
        return $main;
    }
    • This reply was modified 3 months ago by  buutqn.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.