Created
November 25, 2019 14:50
-
-
Save hedqvist/e5f8ffc528abf8b5f27579f2267490f1 to your computer and use it in GitHub Desktop.
Fortnox - Set PhoneNumber to both Phone1 and Phone2 fields in Fortnox
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
<?php | |
/** | |
* @snippet WooCommerce -Fortnox - Set PhoneNumber to Phone2 field in Fortnox | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 3.8.0 | |
*/ | |
function redlight_fortnox_order_both_phone_fields( $orderData, $order_id) { | |
$order = new WC_Order($order_id); | |
$orderData['Order']['Phone2'] = $order->get_billing_phone(); | |
return $orderData; | |
} | |
add_filter('obj_fortnox_order_data', 'redlight_fortnox_order_both_phone_fields', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment