I attempted to ask Customizr support what my code was running into, but they basically said they do not support 3rd party plugins such as Woocommerce
I needed to restrict the payment types based on what folk were buying on the site. For example, the Check payment type is only available for people buying lessons.
Here is the code that does this:
<?php
add_filter( 'woocommerce_available_payment_gateways',
'threshold_unset_gateway_by_category' );
function threshold_unset_gateway_by_category( $available_gateways ) {
global $woocommerce;
$unset = false;
$category_ids = array( 22, 21, 25, 20);
foreach ( $woocommerce->cart->get_cart() as $key => $values ) {
$terms = get_the_terms( $values['product_id'], 'product_cat' );
foreach ( $terms as $term ) {
if ( in_array( $term->term_id, $category_ids ) ) {
$unset = true;
break;
}
}
}
if ( $unset == true ) unset( $available_gateways['cheque'] );
return $available_gateways;
}
I have dug into the Customizr files but I cannot find any conflict. The Wordpress files can be a bit convoluted, so I might be barking up the wrong tree.