Created
October 7, 2015 15:03
-
-
Save NiklasHogefjord/1c2fcc9fc681ba1e1a13 to your computer and use it in GitHub Desktop.
Klarna for WooCommerce - Filter Create order object sent to Klarna for disabling autofocus of email field
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
/** | |
* WooCommerce - Klarna payment gateway | |
* Filter Create order for disabling autofocus of email field. | |
**/ | |
// New order ($create) | |
add_filter('kco_create_order', 'my_kco_create_order'); | |
function my_kco_create_order( $create ) { | |
$create['gui']['options'] = array('disable_autofocus'); | |
return $create; | |
} |
Received this snippet from Krokedil which worked for me
/**
* WooCommerce - Klarna payment gateway
* Filter Create order for disabling autofocus of email field.
**/
// New order ($create)
add_filter('kco_wc_create_order', 'my_kco_create_order');
function my_kco_create_order( $create ) {
$create['gui']['options'] = array('disable_autofocus');
return $create;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, should this work with adding the those lines to functions.php? with the modified line 7 for WooCommerce Klarna Gateway 2.5.11 it still focuses to form.
https://github.com/woocommerce/woocommerce-gateway-klarna