Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created October 12, 2021 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webtoffee-git/26997518f2043445dc6071ec718ff9f0 to your computer and use it in GitHub Desktop.
Save webtoffee-git/26997518f2043445dc6071ec718ff9f0 to your computer and use it in GitHub Desktop.
To hide 'Proceed to checkout' button when using the minimum order amount snippet by WooCommerce- https://www.webtoffee.com/product/paypal-express-checkout-gateway-for-woocommerce/
<?php // do not copy this line
function eh_woocommerce_available_payment_gateways($available_gateways) {
// Set this variable to specify a minimum order value
$minimum = 50;
if ( WC()->cart->total < $minimum ) {
if(isset($available_gateways['eh_paypal_express'])){
unset($available_gateways['eh_paypal_express']);
}
}
return $available_gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'eh_woocommerce_available_payment_gateways');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment