• Hi,

    We only want to display “hurtigkasse” (“Kj?p n? med Vipps”, not “kj?p”). How can it be disabled from the site?

    Best wishes, Hans Petter Wiken

    • This topic was modified 3 years, 7 months ago by hpwiken.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Iver Odin Kvello

    (@iverok)

    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);
    Thread Starter hpwiken

    (@hpwiken)

    Hi, I tried inserting it at the bottom of the functions.php, but the site breaks.

    Plugin Author Iver Odin Kvello

    (@iverok)

    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.

    Thread Starter hpwiken

    (@hpwiken)

    Hi,

    I went with the plug-in route. It is disabled, but the button still shows…

    Plugin Author Iver Odin Kvello

    (@iverok)

    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.

    Thread Starter hpwiken

    (@hpwiken)

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need only hurtigkasse’ is closed to new replies.