Created
June 3, 2020 08:43
-
-
Save hedqvist/acc04cf1ffdb041d30633a6e1e6627c2 to your computer and use it in GitHub Desktop.
Fortnox - Order meta
This file contains hidden or 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 plugin by Redlight Media - Add Ordermeta to field in Fortnox | |
| * @compatible WooCommerce 4.1.1 | |
| */ | |
| function redlight_fortnox_doorcode( $orderData, $order_id) { | |
| $order = new WC_Order($order_id); | |
| $doorcode = $order->get_meta('_doorcode', true); | |
| if($doorcode){ | |
| $orderData['Order']['Remarks'] .= "\r\n"."Portkod: ".$doorcode; | |
| } | |
| return $orderData; | |
| } | |
| add_filter('obj_fortnox_order_data', 'redlight_fortnox_doorcode', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment