Display Role on Invoice or Receipt Part 2
-
Hi
Just looking at https://www.ads-software.com/support/topic/display-role-on-invoice-or-receipt/
I have managed to also get the role displaying on the invoice using mowlman’s code, which is great.
However, i require some tweaks, and the topic ‘Display Role on Invoice or Receipt’ is closed to new replies.
So, here is the code again:
<?php /* Add Shopper Role to Receipt START */ ?> <div class=”shopper-role”> <h3><?php $cust_user = get_post_meta( $order->id, ‘_customer_user’, true ); //get user for order $user_info = get_userdata($cust_user); //get user info for user echo ‘Shopper Role : ‘ . ucwords(implode(‘, ‘, $user_info->roles)) . “\n”; //get the roles for the user & make them titlecase with ucwords /* Add Shopper Role to Receipt END */ ?></h3> </div><!– .shopper-role –>
I would like to only display this when the customer is of a specific role, and, also, the invoice, with code above, is displaying the user role id, not the user role name, which is what i want, e.g. Mill Member.
Help with this very much appreciated.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Display Role on Invoice or Receipt Part 2’ is closed to new replies.