I am what I am

//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' );

woo commerce add to cart redirect to checkout or any other url.

 

You might have noticed that wordpress widget title do not have link.

But what if we need to add it? Well! This video contains the answer 🙂

for code snippet used in this video please visit below link.
http://wp-lovers.com/allow-to-add-link-and-wordpress-widget-title/

 

// allow html in category and taxonomy descriptions
remove_filter( 'pre_term_description', 'wp_filter_kses' );
remove_filter( 'pre_link_description', 'wp_filter_kses' );
remove_filter( 'pre_link_notes', 'wp_filter_kses' );
remove_filter( 'term_description', 'wp_kses_data' );