Show Balance After on wp admin user transaction logs

[ad_1]

@ogmic Use the attached code in the theme functions.php file.

add_filter('manage_woo_wallet_transactions_columns', 'manage_woo_wallet_transactions_columns_callback', 10, 1);
if(!function_exists('manage_woo_wallet_transactions_columns_callback')) {
	function manage_woo_wallet_transactions_columns_callback($columns) {
		$result = array_merge(array_slice($columns, 0, 3), ['balance' => __('Balance After')], array_slice($columns, 3));
		return $result;
	}
}

add_filter('woo_wallet_transaction_details_column_default', 'woo_wallet_transaction_details_column_default_callback', 10, 3);
if(!function_exists('woo_wallet_transaction_details_column_default_callback')) {
	function woo_wallet_transaction_details_column_default_callback($data, $column_name, $item) {
		if('balance' === $column_name){
			$transaction = get_wallet_transaction($item['transaction_id']);
			return wc_price($transaction->balance);
		}
		return $data;
	}
}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer