0

I want to change the "Woocommerce Status" text in dashboard widget. See the image: Woocommerce Status

I found this code in http://stackoverflow.com but it not working.

function change_add_to_cart_message( $translated, $text, $domain  ) {
    global $pagenow;
    if( $text === 'WooCommerce status' && $domain === 'woocommerce' && is_admin() && $pagenow === 'index.php' ){
        $translated = __( 'WooCommerce summary', $domain );
    }
    return $translated;
}
add_filter(  'gettext',  'change_add_to_cart_message', 10, 3 );

  • Use $text === 'WooCommerce Status' - note the uppercase S - in your code, it's in lowercase. – Sally CJ Aug 3 '19 at 0:33
  • 1
    Oh Thank you, I thought that I tried it. It's work. :) – Maher Aldous Aug 3 '19 at 0:40
0
/*Wedgets Status*/
function change_add_to_cart_message( $translated, $text, $domain  ) {
    global $pagenow;
    if( $text === 'WooCommerce Status' && $domain === 'woocommerce' && is_admin() && $pagenow === 'index.php' ){
        $translated = __( 'Resumo de Vendas', $domain );
    }
    return $translated;
}
add_filter(  'gettext',  'change_add_to_cart_message', 10, 3 );
/*Wedgets Reviews*/
function woocommerce_dashboard_recent_reviews( $translated, $text, $domain  ) {
    global $pagenow;
    if( $text === 'WooCommerce Recent Reviews' && $domain === 'woocommerce' && is_admin() && $pagenow === 'index.php' ){
        $translated = __( 'Avaliações de Produtos', $domain );
    }
    return $translated;
}
add_filter(  'gettext',  'woocommerce_dashboard_recent_reviews', 10, 3 );
| improve this answer | |
-1

Just Change the S in status word to the uppercase, so instead of WooCommerce status use WooCommerce Status. Thanks to Sally CJ

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.