Actions
↑ Back to top
1. Simple CSS changes
↑ Back to top
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#kco-wrapper #kco-order-review, | |
#kco-wrapper #kco-iframe { | |
width: 100%; | |
float: none; | |
clear: both; | |
} |
2. Remove, add and move with action hooks
↑ Back to topThe checkout template file
templates/klarna-checkout.php On the Klarna Checkout template page, there are several action hooks you can use to add code or content. These hooks have the following names:kco_wc_before_checkout_form
kco_wc_before_order_review
kco_wc_after_order_review
kco_wc_before_snippet
kco_wc_after_snippet
kco_wc_after_checkout_form

3. Create your own template file
↑ Back to toptemplates
folder in the plugin. To overwrite the file, copy it from the plugin, then paste it into the /woocommerce
folder in your theme. Now you have the opportunity to make the changes you want. Keep in mind that the action hooks kco_wc_before_checkout_form
and kco_wc_after_snippet
must remain for the plugin to work properly.
Filters
↑ Back to topModify order data sent to Klarna
↑ Back to topkco_wc_api_request_args
as described in the following example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use together with Klarna Checkout for WooCommerce (v3 platform) | |
* https://wordpress.org/plugins/klarna-checkout-for-woocommerce/ | |
* | |
* Filter the purchase country sent to Klarna. | |
* Add this code to your themes functions.php file or include it in a separate functionality plugin (https://css-tricks.com/wordpress-functionality-plugins/). | |
**/ | |
add_filter( 'kco_wc_api_request_args', 'krokedil_change_klarna_country' ); | |
function krokedil_change_klarna_country( $request_args ) { | |
if ( method_exists( WC()->customer, 'shipping_country' ) ) { | |
$request_args['purchase_country'] = WC()->customer->shipping_country; | |
} | |
return $request_args; | |
} |