1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
<?php
class Token_customer extends Token
{
private $CI;
public function __construct()
{
parent::__construct();
$this->CI =& get_instance();
$this->CI->load->library('sale_lib');
}
public function get_value()
{
$customer_id = $this->CI->sale_lib->get_customer();
if($customer_id != -1)
{
$customer_info = $this->CI->Customer->get_info($customer_id);
if($customer_info != '')
{
return trim($customer_info->first_name . ' ' . $customer_info->last_name);
}
}
return '';
}
}