Created
July 5, 2018 06:46
-
-
Save hedqvist/61abec3d8b43c78ff639dfce9cc5c6bb to your computer and use it in GitHub Desktop.
Custom field to REGISTRED USERS in Fortnox
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 - (REGISTRED USERS) Set $our_custom_field as Comment field to Fortnox via functions.php | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.0.6 | |
| */ | |
| function redlight_custom_customerdata( $customer) { | |
| $our_custom_field = (!empty($_POST['our_custom_field'])) ? $_POST['our_custom_field'] : ""; | |
| if(isset($our_custom_field)){ | |
| $customer['Customer']['Comments'] = $our_custom_field; | |
| } | |
| return $customer; | |
| } | |
| add_filter( 'obj_fortnox_customer_data', 'redlight_custom_customerdata'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment