Created
October 12, 2021 05:02
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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