Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 119538

qrafts on "[Plugin: WooCommerce - excelling eCommerce] payment methods by product category"

$
0
0

I'm trying to convert this code to product_category:

add_filter('woocommerce_available_payment_gateways','filter_gateways',1);

function filter_gateways($gateways){
global $woocommerce;
 foreach ($woocommerce->cart->cart_contents as $key => $values ) {
//store product id's in array
$highpriceditems = array(56,57);			

  if(in_array($values['product_id'],$highpriceditems)){	

                                    unset($gateways['paypal']);
break;
                                }}
return $gateways;
}

From this post


Viewing all articles
Browse latest Browse all 119538

Trending Articles