Try adding this to your child-themes functions.php or a small plugin:
add_filter('woo_vipps_is_available', function ($ok, $gw) {
if (is_checkout()) return false;
return $ok;
}, 10, 2);
Hi, I tried inserting it at the bottom of the functions.php, but the site breaks.
The code is actually tested; could you check your error logs and see what the error message is? There is probably some issue with syntax or how it was pasted.
Alternatively, create a single file in wp-content/plugins/ called something like “vipps-express-only.php”, with contents
<?php
/**
* Plugin Name: Vipps: Only use Express Checkout
* Description: Disable Vipps on the checkout page but allow Express Checkout
* Version: 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_filter('woo_vipps_is_available', function ($ok, $gw) {
if (is_checkout()) return false;
return $ok;
}, 10, 2);
– and then activate the plugin in the normal way.
Hi,
I went with the plug-in route. It is disabled, but the button still shows…
I think I must have misunderstood: The plugin in question disables the “normal” Vipps checkout function, leaving only express checkout available. Are you instead talking about the “Kjøp” (“Buy”) butto that puts products into the shopping cart?
If so you can remove it using CSS like this:
.woocommerce button.single_add_to_cart_button {
display: none;
}
.woocommerce a.button.add_to_cart_button {
display: none;
}
In that case you don’t need the plugin at all, unless you want to ensure that the normal checkout page does not include Vipps.
Thanks! Now it looks like we want it: only Vipps hurtigkasse, and a message that the potential member need to make contact by mail to pay by other means if they cannot use vipps.