mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-01 11:52:25 +08:00
https://stackoverflow.com/questions/75290917/woocommerce-hide-coupon-field-but-not-for-logged-in-users
7 lines
209 B
Text
7 lines
209 B
Text
function hide_coupon_field_on_cart( $enabled ) {
|
|
if( !is_user_logged_in() ){
|
|
return false;
|
|
}
|
|
return $enabled;
|
|
}
|
|
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_cart' );
|