Last active
January 23, 2023 12:56
-
-
Save hedqvist/7486f1fadb61de7fafd9cc6f52986d2c to your computer and use it in GitHub Desktop.
Add payment method title to Fortnox order-comments
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 payment method title to Fortnox order-comments via functions.php | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 3.2.6 | |
*/ | |
function redlight_fortnox_payment_method_title( $orderData, $order_id) { | |
$order = wc_get_order($order_id); | |
$orderData['Order']['Remarks'] .= "\r\n"."Betalsätt: ".$order->get_payment_method_title(); | |
return $orderData; | |
} | |
add_filter('obj_fortnox_order_data', 'redlight_fortnox_payment_method_title', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment