Tag: woo shop

Disable Payment Method for Specific Category in WooCommerce

Today we investigate the WooCommerce Checkout and explicitly at how to cripple an installment portal (for example PayPal) if certain item classifications are in the truck. add_filter( ‘woocommerce_available_payment_gateways’, ‘ikodes_unset_gateway_by_category’ ); function ikodes_unset_gateway_by_category( $available_gateways ) { global $woocommerce; $unset = false; $category_ids = array( 123, 111 ); foreach ( $woocommerce->cart->cart_contents as $key => $values ) {