Hướng dẫn đa ngôn ngữ shipping title trong wordpress

huong dan da ngon ngu shipping title trong wordpress

Hướng dẫn đa ngôn ngữ shipping title trong wordpress

add_filter( 'woocommerce_cart_shipping_method_full_label', 'change_cart_shipping_method_full_label', 10, 2 );
function change_cart_shipping_method_full_label( $label, $method ) {
    $lang = get_bloginfo("language");
    if( $method->method_id == 'jem_table_rate' && $lang == 'en-GB' ){
        $label = 'Shipping fee: '. number_format($method->cost). get_woocommerce_currency_symbol() ;
    }

    if( $method->method_id == 'jem_table_rate' && $lang == 'vi' ){
        $label = 'Phí giao hàng: ' . number_format($method->cost) . get_woocommerce_currency_symbol();
    }
   
    return  $label;
}