Last active
October 5, 2023 07:56
-
-
Save hedqvist/de970c56f9f384d6ed82a2eaba087da3 to your computer and use it in GitHub Desktop.
Fortnox - Set custom ordernumber, add this to "YourOrderNumber" 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 # infront of ordernumber, add this to "YourOrderNumber" in Fortnox | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 8.0.2 | |
*/ | |
function redlight_fortnox_order_ordernumber_prefix( $orderData, $order_id) { | |
$order = wc_get_order($order_id); | |
$orderData['Order']['YourOrderNumber'] = $order->get_meta('_custom_order_number', true); | |
return $orderData; | |
} | |
add_filter('obj_fortnox_order_data', 'redlight_fortnox_order_ordernumber', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment