Guest User

Untitled

a guest
Jan 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * @snippet WooCommerce - Fortnox plugin by Redlight Media - Update Article name to article in Fortnox via functions.php
  5. * @author Redlight Media AB / Christopher Hedqvist
  6. * @compatible WooCommerce 3.5.3
  7. */
  8. function redlight_update_article( $article, $product_id) {
  9. $WC_Product = wc_get_product($product_id);
  10. $article->Article['Description'] = $WC_Product->get_name();
  11. return $article;
  12. }
  13. add_filter('obj_fortnox_article_data_before_update', 'redlight_update_article', 10, 2 );
Add Comment
Please, Sign In to add comment