• Resolved matteobaro

    (@matteobaro)


    i have this code for tax exempt capabilities

      if (is_user_logged_in() && !is_admin()) {
    	add_filter( 'init', 'make_customer_tax_exempt' );
     }
     function make_customer_tax_exempt() {
    	global $woocommerce;
    	$tax_exempt = current_user_can( 'tax_exempt' );
    	$woocommerce->customer->set_is_vat_exempt( $tax_exempt );
     }

    with user role editor work, with aam doesn’t work… how can i fix that ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter matteobaro

    (@matteobaro)

    for the entire user role works, but i need for single user and in this case it doesn’t work

    Noel

    (@noelalvarez)

    hi @matteobaro,

    This code you have added is adding tax exempt to all login users and not admin on your woocommerce site.

    So if you want a tax exempt for a Single user you might want to get the right code from woocommerce support for this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘current_user_can doesn’t work’ is closed to new replies.