Created
June 11, 2018 09:40
-
-
Save hedqvist/b10cd5b1b42ba1bb735fd745677ff6d3 to your computer and use it in GitHub Desktop.
Add order currency to Fortnox order-data
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 order currency to Fortnox | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.3.5 | |
| */ | |
| function redlight_fortnox_order_currency( $orderData, $order_id) { | |
| $order = new WC_Order($order_id); | |
| $orderData['Order']['Currency'] = $order->get_currency(); | |
| return $orderData; | |
| } | |
| add_filter('obj_fortnox_order_data', 'redlight_fortnox_order_currency', 100, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment