//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' );
The Vaghela
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
Tuesday, 1 December 2015
Chhand Part-1, Gujarati Grammer (ગુજરાતી વ્યાકરણ - છંદ - ભાગ ૧)
Sunday, 16 August 2015
Saturday, 8 August 2015
WordPress: Bitcoin Address Validation (Field Validation) with Gravity Form
The piece of code used in this video can be found here.
http://rosettacode.org/wiki/Bitcoin/address_validation#PHP
http://rosettacode.org/wiki/Bitcoin/address_validation#PHP
Wordpress: Add Custom Taxonomy Filter at WordPress Admin Side/ Wordpress Backend
In this video we will add custom taxonomy dropdown filter at the backend of WordPress(Admin Interface)
Resource of the file that we used in this video.
https://gist.github.com/bainternet/4722496
https://gist.github.com/bainternet/4722496
Subscribe to:
Posts (Atom)