Created
April 29, 2015 09:04
-
-
Save NiklasHogefjord/582213ad736aac46681f to your computer and use it in GitHub Desktop.
Klarna for WooCommerce - filter the phone number returned from Klarna (KCO)
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 the phone number returned from Klarna when customer pays via Klarna Checkout. | |
* Useful when you want to add the country prefix to the phone number. | |
* | |
**/ | |
add_filter('klarna_checkout_billing_phone', 'my_custom_klarna_checkout_billing_phone'); | |
function my_custom_klarna_checkout_billing_phone( $phone_number ) { | |
$country_code = '+47'; | |
$new_phone_number = $country_code . $phone_number; | |
return $new_phone_number; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment