WooMinecraft / woominecraft-wp

A FREE Minecraft Donation Plugin for WordPress designed to work in conjunction with WooMinecraft for Bukkit/Spigot & WooCommerce to allow the purchasing of virtual items in MineCraft and have them delivered to the servers.
https://wordpress.org/plugins/woominecraft/
GNU General Public License v2.0
31 stars 14 forks source link

Minecraft name variable in form.. what is the variable name? #108

Open Mrs-Feathers opened 1 year ago

Mrs-Feathers commented 1 year ago

Hello! i'm editing my woocommerse emails manually to simply include the player's username as one of the fields it shows in the order email and email to customer for an easier time keeping record if someone uses a bad minecraft username, they can show an email to our staff and they can fix it without having administrative access to the website or to woocommerce... and i'm having a bit of a hard time finding it in any of the information here.

so basically, very simply, my question is "what is the variable i need to write in the code to show the user's minecraft username in the order email?"

i love this plugin/wordpress mod and i hope this functionality is possible and maybe that finding an answer to this question will allow others to configure their setups in a similar way for ease of use

JayWood commented 1 year ago

So if you have access to the order ID, you can get it by pulling the player_name post meta. It's set here: https://github.com/WooMinecraft/woominecraft-wp/blob/a4ed39b74452c0a6bec1eabc9d761c5d8c306da7/includes/order-manager.php#L60

Would be something like:

get_post_meta( $order_id, 'player_id', true );