• Resolved pschienemann

    (@pschienemann)


    hello all,

    we would like to use the plugin: Klarna Payments for WooCommerce in version 2.7.1 on our website. Unfortunately, the payment method is not visible in the check out, so that it cannot be selected.
    We continue to use the plug-in Germanized Basic + Germanized for WooCommerce Pro in version 3.3.6, which we had already deactivated for testing purposes. What else could be the reason?
    We have already tried everything (incl: https://woocommerce.com/document/klarna-payments/#section-2) and tried all the settings.

    Thanks and best regards

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Because I think you double check country settings:
    We had a similar problem, but only for some products.
    It is also described on the page you link: Klarna do not support decimal places in quantity.
    But because it really don’t makes sense, you can quickly overread this fact.

    You can workaround it, by applying this to a custom plugin:
    https://paste.redoo.cloud/?5e6b108a8da39d2b#C5KKXuv4vJzzDajauap22pWPzHYc2aPk3cCz42eHRThU
    This convert orderlines with decimal places to a quantity 1 to be able to pay with Klarna.

    Thread Starter pschienemann

    (@pschienemann)

    Hi,

    thx for your answer. where do I insert the code?

    best regards

    kristiklarna

    (@kristiklarna)

    lindareinhold

    (@lindareinhold)

    Closing this ticket due to no response and tip/help links are added, but please let us know if further support is needed.

    lenaka

    (@lenaka)

    Same problem. Tried to add the code to Code Snippets, but it returned a Fatal Error. Any ideas?

    krokedilmartin

    (@krokedilmartin)

    Hello Lenaka.

    We recommend that you use the Measurement Price Calculator plugin:
    https://docs.krokedil.com/klarna-payments-for-woocommerce/get-started/introduction/#compatibility-with-themes-plugins

    Redoo Networks GmbH

    (@redoonetworks)

    We are not sure how “Code Snippets” are working, but we don’t recommend the usage of WordPress Plugins, which execute any PHP code someone enter.

    We added this code into a custom plugin. I’m sure it cannot create a Fatal error.

    Because the solution works really great for us, but link will expire shortly, I posted code here:

    
    <?php
     
    add_filter('kp_wc_api_order_lines', array('kp_wc_api_order_lines'), 10, 2);
     
    function kp_wc_api_order_lines($orderLines, $orderId) {
    	foreach($orderLines as $index => $orderline) {
    		if($orderline['quantity'] != floor($orderline['quantity'])) {
    			$orderLines[$index]['unit_price'] = $orderLines[$index]['unit_price'] * $orderLines[$index]['quantity'];
    			$orderLines[$index]['quantity'] = 1;
    		}
    	}
     
    	return $orderLines;
    }
    

    @krokedilmartin This Measurement Price Plugin works great, but needs similar time to configure + payment every year for updates, then it needs to implement a simple calculation in code without any recurring payment.
    Not every client decide to use the recurring payment. So this code makes your plugin compatible with all custom implementations.

    lenaka

    (@lenaka)

    Code Snippets is a very popular plugin for exactely this purpose. However, I also added it to my childtheme’s functions.php (without the php tag of course) but it also broke my site.
    But I guess my problem is related to some issues with my Klarna API, I contacted them an hope it will be sort out soon.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Klarna is not visible as a payment method’ is closed to new replies.