【发布时间】:2017-06-20 11:57:50
【问题描述】:
在产品页面的“下拉菜单”上,我想修改 SELECT OPTIONS 文本,我认为这段代码可以做到这一点,但即使我清空缓存,我的页面也没有任何变化。 感谢您的帮助
add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
function custom_woocommerce_product_add_to_cart_text() {
global $product;
$product_type = $product->product_type;
switch ( $product_type ) {
case 'variable':
return __( 'Options', 'woocommerce' );
break;
}
}
【问题讨论】:
标签: woocommerce