From dd21f205b7482233928041bb72563c553c2a4891 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 22 Apr 2017 09:30:53 +0100 Subject: [PATCH] Fix wrong code issue (#1247) --- application/controllers/Sales.php | 15 +-------------- application/models/Customer.php | 4 ++-- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 620e31aaf..0624fa8fb 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -829,21 +829,8 @@ class Sales extends Secure_Controller { $cust_stats = $this->Customer->get_stats($customer_id); $data['customer_total'] = empty($cust_stats) ? 0 : $cust_stats->total; - - // retrieve the info from Mailchimp only if there is an email address assigned - if(!empty($customer_info->email)) - { - $this->load->library('mailchimp_lib'); - - $list_id = $this->encryption->decrypt($this->config->item('mailchimp_list_id')); - - // collect mailchimp customer info - if(($mailchimp_info = $this->mailchimp_lib->getMemberInfo($list_id, $customer_info->email)) !== FALSE) - { - $data['mailchimp_info'] = $this->xss_clean($mailchimp_info); - } - } } + $data['customer_info'] = implode("\n", array( $data['customer'], $data['customer_address'], diff --git a/application/models/Customer.php b/application/models/Customer.php index f2c6dce08..1cb9f464e 100644 --- a/application/models/Customer.php +++ b/application/models/Customer.php @@ -89,9 +89,9 @@ class Customer extends Person } /* - Gets total about a particular customer + Gets stats about a particular customer */ - public function get_totals($customer_id) + public function get_stats($customer_id) { $this->db->select('SUM(payment_amount) AS total'); $this->db->from('sales');