Show hide payment gateways based on backordered items in Woocommerce
问题 I'm need to hide paypal when there's any backordered item on cart or hide cod if there's not any item to be backordered. My problem here is if there's a item that's backorder together with one that is not, I end up whitout a payment processor add_filter( 'woocommerce_available_payment_gateways', 'backordered_items_hide_cod', 90, 1 ); function backordered_items_hide_cod( $available_gateways ) { // Only on front end if ( is_admin() ) return; // Loop through cart items foreach( WC()->cart->get