//Check if product is available in cart or not.
function is_product_in_cart( $prodids ){
$product_in_cart = false;
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$product = $cart_item['data'];
if ( in_array( $product->id, $prodids ) ) {
$product_in_cart = true;
}
}
return $product_in_cart;
}
// Disable gateway based on product
function payment_gateway_disable_product( $available_gateways ) {
global $woocommerce;
//print_r( $available_gateways );
$prodids=array(14,15);
if ( isset( $available_gateways['paypal'] ) && is_product_in_cart( $prodids ) ) {
unset( $available_gateways['paypal'] );
}
return $available_gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'payment_gateway_disable_product' );
Sunday, 11 December 2016
How to hide or disable payment gateway in wooCmmerce
Saturday, 21 May 2016
Maths: Work and Time, ગણિત: કામ અને મહેનતાણું - Lang: Gujarati
Download our app CEC(competitive exam cracker)
https://play.google.com/store/apps/details?id=com.gpscvideos&hl=en
Sunday, 3 January 2016
Chhand Part-2, Gujarati Grammer (ગુજરાતી વ્યાકરણ - છંદ - ભાગ - ૨)
છંદનાં બંધારણ વિશેની માહિતી. લઘુ-ગુરુ અક્ષરના બનેલા જુથને ગણ કહે છે. આવા આઠ ગણ છે આ યાદ રાખવા નીચેની પંક્તિ તૈયાર કરવામાં આવી છે. ય , મા, તા, રા, જ, ભા, ન, સ, લ, ગા. ય = યમાતા = ય ગણ ( - U U ) મા = માતારા = મ ગણ ( - - - ) તા = તારાજ = ત ગણ ( - - U ) રા = રાજભા = ર ગણ ( - U - ) જ = જભાન = જ ગણ ( U - U ) ભા = ભાનસ = ભ ગણ ( - U U) ન = નસલ = ન ગણ ( U U U ) સ = સલગા = સ ગણ (UU-) લ = લઘુ = ( U ) ગણ ગા = ગુરુ = ( - ) ગણ
Download our app CEC(competitive exam cracker) https://play.google.com/store/apps/details?id=com.gpscvideos&hl=en
Subscribe to:
Posts (Atom)