PHP Snippet#1:删除“ X已添加到您的购物车”消息
add_filter( 'wc_add_to_cart_message_html', '__return_null' );
PHP Snippet#2:编辑“已添加到您的购物车”消息
add_filter( 'wc_add_to_cart_message_html', 'bbloomer_custom_add_to_cart_message' );
function bbloomer_custom_add_to_cart_message() {
$message = 'Nicely done!' ;
return $message;
}