Created
August 11, 2020 14:04
-
-
Save hedqvist/72fdbc3a440e99f88175afe8bb7ede1d to your computer and use it in GitHub Desktop.
Fortnox - Project code
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 - Set Project | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.1.1 | |
| */ | |
| function redlight_fortnox_order_project( $orderData, $order_id) { | |
| switch( get_site_url() ){ | |
| case 'https://www.example.com': | |
| $orderData['Order']['Project'] = 'PROJEKT1'; | |
| break; | |
| case 'https://www.mydomain.com': | |
| $orderData['Order']['Project'] = 'PROJEKT2'; | |
| break; | |
| case 'https://www.domain.com': | |
| $orderData['Order']['Project'] = 'PROJEKT3'; | |
| break; | |
| } | |
| return $orderData; | |
| } | |
| add_filter('obj_fortnox_order_data', 'redlight_fortnox_order_project', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment