Contact Info Snippet

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.2 kB
0
Indexable
Never
add_action('salesking_my_orders_custom_columns', function(){
	?>
	<th class="nk-tb-col tb-col-md"><span class="sub-text d-none d-mb-block"><?php esc_html_e('Contact Details','marketking-multivendor-marketplace-for-woocommerce'); ?></span></th>
	<?php
});


add_action('salesking_my_orders_custom_columns_footer', function(){
	?>
	<th class="nk-tb-col tb-col-md"><?php esc_html_e('contact','marketking-multivendor-marketplace-for-woocommerce'); ?></th>
	<?php
});

add_action('salesking_my_orders_custom_columns_content', function($order){
	?>
	<td class="nk-tb-col">

	    <div>
	        <span class="tb-lead"><?php 

	        $user_id = $order->get_customer_id();
	        $user_meta = get_userdata($user_id); 
            $user_roles = $user_meta->roles;
            $rolename = '';
            foreach ($user_roles as $role){
                $rolename = wp_roles()->get_names()[ $role ];
            }


	        echo 'Address: '.esc_html($order->get_billing_address_1().' '.$order->get_billing_address_2()).'<br>';
	        echo 'Contact Nr: '.esc_html($order->get_billing_phone()).'<br>';
	        echo 'Role: '.$rolename.'<br>';
	        ?></span>
	    </div>

	</td>
	<?php
});