• Resolved antonvanska

    (@antonvanska)


    Hi,

    I’m using this plugin (https://ww.wp.xz.cn/plugins/order-minimum-amount-for-woocommerce/) to set a minimum order value for Decna.no e-commerce. Anyways, the Vipps Express checkout doesn’t check the cart value when clicked on in the cart, which means that people can checkout with any value when using it.

    In an earlier thread, I found the following filters to fix it but couldn’t get them to work.

    $supports = apply_filters('woo_vipps_cart_supports_express_checkout', $supports, $cart);
    
    add_filter('woo_vipps_cart_supports_express_checkout', function ($supports) {
       WC()->cart->calculate_totals();
       if (WC()->cart->get_cart_total() < 350) return false;
       return $supports;
     });
    

    I added them to the child theme functions.php, but the Vipps button in the cart just disappeared. Could you help me please?

    Thanks!

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

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

    (@iverok)

    Yes, sorry about that: The code you quoted has an error; “get_cart_total()” returns a formatted price including HTML and the currency symbol. The below should work better:

    add_filter('woo_vipps_cart_supports_express_checkout', function ($supports, $cart) {
       WC()->cart->calculate_totals();
       if (WC()->cart->total<350) return false;
       return $supports;
     }, 10, 2);
    Thread Starter antonvanska

    (@antonvanska)

    Thank you for the support!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Minimum order value for express checkout’ is closed to new replies.