Untitled

mail@pastecode.io avatar
unknown
plain_text
18 days ago
767 B
2
Indexable
Never
add_action('salesking_customers_custom_columns_header', function(){
	?>
	<th class="nk-tb-col tb-col-md"><span class="sub-text"><?php esc_html_e('Customer Group','salesking'); ?></span></th>
	<?php
});
add_action('salesking_customers_custom_columns_content', function($customer){
	?>
	<td class="nk-tb-col tb-col-md">
	    <div>
	        <span class="tb-amount"><?php 
	        $user_id = $customer->get_id();
	        $is_b2b = get_user_meta($user_id, 'b2bking_b2buser', true);
	        if ($is_b2b === 'yes'){
	        	$group = get_user_meta($user_id, 'b2bking_customergroup', true);
	        	$group_title = get_the_title($group);
	        	echo $group_title;
	        } else {
	        	echo 'B2C';
	        }

	    ?></span>
	    </div>
	</td>
	<?php
}, 10, 1);
Leave a Comment