Skip to content

Instantly share code, notes, and snippets.

@NiklasHogefjord
Last active August 16, 2017 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NiklasHogefjord/3b9a12fec1eb2e5f72008a88b73e5fbd to your computer and use it in GitHub Desktop.
Save NiklasHogefjord/3b9a12fec1eb2e5f72008a88b73e5fbd to your computer and use it in GitHub Desktop.
Updated compatibility file for WCML (https://wordpress.org/plugins/woocommerce-multilingual/) used to get Klarna Checkout payment gateway (https://woocommerce.com/products/klarna) to work with WCML/WPML multi currencies in WooCommerce.
<?php
class WCML_Klarna_Gateway{
public function add_hooks(){
add_filter( 'wcml_multi_currency_ajax_actions', array( $this, 'ajax_action_needs_multi_currency' ) );
}
function ajax_action_needs_multi_currency( $actions ){
$actions[] = 'klarna_checkout_cart_callback_update';
$actions[] = 'klarna_checkout_coupons_callback';
$actions[] = 'klarna_checkout_remove_coupon_callback';
$actions[] = 'klarna_checkout_cart_callback_remove';
$actions[] = 'klarna_checkout_shipping_callback';
$actions[] = 'kco_iframe_shipping_option_change_cb';
$actions[] = 'klarna_checkout_order_note_callback';
$actions[] = 'kco_iframe_change_cb';
$actions[] = 'kco_iframe_shipping_address_change_v2_cb';
$actions[] = 'kco_iframe_shipping_address_change_cb';
return $actions;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment