• Resolved aufwindkg

    (@aufwindkg)


    Hello,

    I am working on a Webshop that got a custom fee in Woocommerce.

    The fee gets applied via the function.php file and if activated, Klarna creates an error on the checkout page called: Bad value: order_lines[4].total_tax_amount

    After research the error states that the total-cart-amount does not match the total-amount to pay via Klarna.

    My question: Can I disable this background check from the Klarna Plug-In? Or is it possible to flag that cart-fee so Klarna doesn’t throw an error?

    Below the used “custom” fee code in functions.php:

    add_action('woocommerce_cart_calculate_fees', function() {
        if (is_admin() && !defined('DOING_AJAX')) {
            return;
        }
        $cart_total_price = WC()->cart->subtotal;
        if($cart_total_price < 10){
            WC()->cart->add_fee(__('Verpackungs-/Servicepauschale', 'txtdomain'), 1); // source: https://woocommerce.wp-a2z.org/oik_api/wc_cartadd_fee/
        }
        
    });

    Thanks for any help!

    • This topic was modified 1 year ago by aufwindkg. Reason: readability
Viewing 1 replies (of 1 total)
  • Plugin Support louisekrokedil

    (@louisekrokedil)


    Hi,

    It is not unfortunately not possible to disable these controls from Klarna in any way.

    Have you tried if this plugin works for you instead? It makes it possible to add custom fees and discounts, we have not fully tested this plugin with our Klarna Checkout for WooCommerce plugin so I can not tell for sure that it will work.

Viewing 1 replies (of 1 total)
  • The topic ‘Error when using fee (bad value)’ is closed to new replies.