Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
German Market - Filter - Kauf auf Rechnung nur bis zu Summe X
add_filter( 'woocommerce_available_payment_gateways', 'my_woocommerce_available_payment_gateways' );
function my_woocommerce_available_payment_gateways( $_available_gateways ) {
if ( isset( $_available_gateways[ 'german_market_purchase_on_account' ] ) ) {
if ( isset( WC()->cart ) ) {
$cart_total = WC()->cart->cart_contents_total + WC()->cart->tax_total;
$maximum = 100; // Hier maximalen Betrag eingeben, bis zu dem Kauf auf Rechnung moegl. seins soll (inkl. Steuern)
if ( $cart_total > $maximum ) {
unset( $_available_gateways[ 'german_market_purchase_on_account' ] );
}
}
}
return $_available_gateways;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.