[php]
/***********************************************************************
* WooCommerce Order Notes Addition
* Add Vorsteuer Hinweis to Order Notes
***********************************************************************
*/
add_action(‚woocommerce_checkout_process‘, ‚add_vorsteuer_to_order_note‘);
function add_vorsteuer_to_order_note() {
global $current_user;
$user_roles = $current_user->roles;
if ( !in_array(‚vorsteuerberechtigt‘, $user_roles ) ) {
return;
} else {
$original_order_comments = $_POST[‚order_comments‘];
$_POST[‚order_comments‘] = $original_order_comments . ‚ (Vorsteuerabzugsberechtigt)‘;
}
return $_POST[‚order_comments‘];
}
[/php]