Title: Error when using fee (bad value)
Last modified: November 6, 2023

---

# Error when using fee (bad value)

 *  Resolved [aufwindkg](https://wordpress.org/support/users/aufwindkg/)
 * (@aufwindkg)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/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:
 *     ```wp-block-code
       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 2 years, 6 months ago by [aufwindkg](https://wordpress.org/support/users/aufwindkg/).
      Reason: readability

Viewing 1 replies (of 1 total)

 *  Plugin Support [louisekrokedil](https://wordpress.org/support/users/louisekrokedil/)
 * (@louisekrokedil)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/error-when-using-fee-bad-value/#post-17235704)
 * 
   Hi,It is not unfortunately not possible to disable these controls from Klarna
   in any way.Have you tried if[ this plugin ](https://wordpress.org/plugins/checkout-fees-for-woocommerce/)
   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.

 * ![](https://ps.w.org/klarna-payments-for-woocommerce/assets/icon-256x256.png?
   rev=3174333)
 * [Klarna for WooCommerce](https://wordpress.org/plugins/klarna-payments-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/klarna-payments-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/klarna-payments-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/klarna-payments-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/klarna-payments-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/klarna-payments-for-woocommerce/reviews/)

## Tags

 * [fee](https://wordpress.org/support/topic-tag/fee/)

 * 1 reply
 * 2 participants
 * Last reply from: [louisekrokedil](https://wordpress.org/support/users/louisekrokedil/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/error-when-using-fee-bad-value/#post-17235704)
 * Status: resolved