Hide the coupon field if not logged in on WooCommerce

Hide the coupon field if not logged in on WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

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' ); 

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.