skip to Main Content

WooCommerce products: Allow backorders only for specific user roles

I want to allow backorders for specific customer roles. Code i writed is: // BackOrder Allow Part #1 add_filter( 'woocommerce_product_backorders_allowed', 'woocommerce_product_backorders_allowed', 10, 3 ); function woocommerce_product_backorders_allowed( $backorder_allowed, $product_id, $product ){ if ( current_user_can('administrator') ) { $backorder_allowed = true; } else…

VIEW QUESTION
Back To Top
Search