修改woocommerce未产品添加购物车提示信息 Please select some product options before adding this product to your cart.

Wordpress修改Woocommerce未选择产品属性添加购物车的提示信息

 

wp062801

找到当前主题的functions.php文件。编辑 添加以下代码:

//修改未选择产品属性的提示信息
add_filter( 'gettext', 'customizing_variable_product_message', 97, 3 );
function customizing_variable_product_message( $translated_text, $untranslated_text, $domain )
{
    if ($untranslated_text == 'Please select some product options before adding this product to your cart.') {
    $translated_text = __( 'Please select the attributes and shipping country before checkout.', $domain );
}
    return $translated_text;
}

wp062802

 

添加代码后保存即可。

最后我们看一下效果:

 

wp062803