Created
January 18, 2019 18:06
-
-
Save hedqvist/6f6b64ce2091f4d3d23ae53d4fe0a46f to your computer and use it in GitHub Desktop.
Update article name when updating products 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 - Update Article name to article in Fortnox via functions.php | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.5.3 | |
| */ | |
| function redlight_update_article( $article, $product_id) { | |
| $WC_Product = wc_get_product($product_id); | |
| $article->Article['Description'] = $WC_Product->get_name(); | |
| return $article; | |
| } | |
| add_filter('obj_fortnox_article_data_before_update', 'redlight_update_article', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment