Error when using fee (bad value)
-
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!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Error when using fee (bad value)’ is closed to new replies.