Last active
November 9, 2022 13:05
-
-
Save hedqvist/631f60d30f7ca06858f2c2874d0f0419 to your computer and use it in GitHub Desktop.
Add EAN code to article 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 - Add EAN code to article in Fortnox via functions.php | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 3.2.6 | |
*/ | |
function redlight_fortnox_ean( $article, $product_id) { | |
$ean_string = get_post_meta( $product_id, 'EAN', true ); | |
$article['Article']['EAN'] = $ean_string; | |
return $article; | |
} | |
add_filter('obj_fortnox_article_data', 'redlight_fortnox_ean', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment