• Resolved Alexandre Froger

    (@frogerme)


    In falang/src/Falang/Filter/Site/WooCommerce.php, translate_wc_product_title produces warnings because of $product->ID = $product->id; on line 191.

    Rewrite of translate_wc_product_title to fix it:

    
    public function translate_wc_product_title($title, $product){
            if (!Falang()->is_default()) {
                $falang_post = new \Falang\Core\Post();
                $post = get_post($product->get_id());
                $translated_product_title = $falang_post->translate_post_field($post, 'post_title', Falang()->get_current_language(), $title);
                return $translated_product_title;
    
            }
            return $title;
        }
    
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Warning: Product properties should not be accessed directly.’ is closed to new replies.