电话:010-8646 9696
手机:1300 1000 118

Our blog

关于Wordpress的有关资讯,不可错过!

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

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

 

找到当前主题的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;
}

添加代码后保存即可。