<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id>AbandonedCart module by iSenseLabs</id>
	<version>1.5.5.x and 1.5.6.x</version>
	<vqmver>2.5</vqmver>
	<author>iSenseLabs</author>
	
	<file name="admin/view/template/common/header.tpl">
		<operation>
			<search position="before"><![CDATA[<li><a class="parent"><?php echo $text_affiliate; ?></a>]]></search>
			<add><![CDATA[
			<?php $abandonedCartsSettings = $this->config->get('AbandonedCarts'); ?>
			<?php if (isset($abandonedCartsSettings['Enabled']) && $abandonedCartsSettings['Enabled']=='yes') { ?>
			<?php $AB_count = $this->db->query("SELECT count(*) as total FROM `" . DB_PREFIX . "abandonedcarts`"); ?>
				<li><a href="index.php?route=module/abandonedcarts&token=<?php echo $_GET['token']; ?>">Abandoned Carts (<?php echo $AB_count->row['total']; ?>)</a>
			<?php } ?>
			]]></add>
		</operation>
	</file> 
	
	<file name="catalog/controller/common/footer.php">
		<operation>
			<search position="before"><![CDATA[protected function index() {]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
				protected function register_abandonedCarts() {
					$ip = (!empty($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : '*HiddenIP*';
					if ($this->customer->isLogged()) {
						$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
					} else {
						$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
					}
					$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
					$cart = $this->cart->getProducts();
					$store_id = (int)$this->config->get('config_store_id');
					$cart = (!empty($cart)) ? $cart : '';
					
					$lastpage = "$_SERVER[REQUEST_URI]";
					
					$checker = $this->customer->getId();
					if (!empty($checker)) {
						$customer = array(
							'id'=> $this->customer->getId(), 
							'email' => $this->customer->getEmail(),		
							'telephone' => $this->customer->getTelephone(),
							'firstname' => $this->customer->getFirstName(),
							'lastname' => $this->customer->getLastName(),
							'language' => $this->session->data['language']
						);
					} 
					$route = isset($this->request->get['route']) ? $this->request->get['route'] : '';
					if ($route!='checkout/success') {
						if (empty($exists->row)) {
							if (!empty($cart)) {
								if (!isset($customer)) {
									$customer = array(
										'language' => $this->session->data['language']
									);
								}
								$cart = json_encode($cart);
								$customer = (!empty($customer)) ? json_encode($customer) : '';
								$this->db->query("INSERT INTO `" . DB_PREFIX . "abandonedcarts` SET `cart`='".$this->db->escape($cart)."', `customer_info`='".$this->db->escape($customer)."', `last_page`='$lastpage', `ip`='$ip', `date_created`=NOW(), `date_modified`=NOW(), `restore_id`='".$id."', `store_id`='".$store_id."'");
								$this->session->data['abanonedCart_ID'] = $id;
							} 
						} else {
							if (!empty($cart)) {
								$cart = json_encode($cart);
								$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `cart` = '".$this->db->escape($cart)."', `last_page`='".$this->db->escape($lastpage)."', `date_modified`=NOW() WHERE `restore_id`='$id'");
							}
							if (isset($customer)) {
								$customer = json_encode($customer);
								$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `customer_info` = '".$this->db->escape($customer)."', `last_page`='".$this->db->escape($lastpage)."', `date_modified`=NOW() WHERE `restore_id`='$id'");
							}
						}
					}
				}
			/* AbandonedCarts - End */
			]]>
			</add>
		</operation>

		<operation>
			<search position="after"><![CDATA[protected function index() {]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
				$this->load->model('module/abandonedcarts');
				$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
				if (isset($abandonedCartsSettings['AbandonedCarts']['Enabled']) && $abandonedCartsSettings['AbandonedCarts']['Enabled']=='yes') { 
					$this->register_abandonedCarts();
				}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file> 
	
	<file name="catalog/controller/checkout/success.php">
		<operation>
			<search position="before"><![CDATA[if (isset($this->session->data['order_id'])) {]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
			$this->load->model('module/abandonedcarts');
			$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
			if (isset($abandonedCartsSettings['AbandonedCarts']['Enabled']) && $abandonedCartsSettings['AbandonedCarts']['Enabled']=='yes') { 
				if ($this->customer->isLogged()) {
					$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
				} else {
					$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
				}
				$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
				if (!empty($exists->row)) {
					$this->db->query("DELETE FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
					$this->session->data['abanonedCart_ID']=''; 
				}
			}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file> 
	
	<file name="catalog/controller/checkout/guest.php">
		<operation>
			<search position="before"><![CDATA[$this->response->setOutput(json_encode($json));]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
			$this->load->model('module/abandonedcarts');
			$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
			if (isset($abandonedCartsSettings['AbandonedCarts']['Enabled']) && $abandonedCartsSettings['AbandonedCarts']['Enabled']=='yes') { 
				$cart = $this->cart->getProducts();
				$cart = (!empty($cart)) ? $cart : '';
				
				if (!empty($cart)) {
					if ($this->customer->isLogged()) {
						$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
					} else {
						$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
					}
					$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
					
					if (empty($exists->row['customer'])) { 
						$customer = array(); 
					
						if (!empty($this->request->post['telephone'])) {
							$customer['telephone'] = $this->request->post['telephone'];
						}
						if (!empty($this->request->post['email'])) {
							$customer['email'] = $this->request->post['email'];
						}
						if (!empty($this->request->post['firstname'])) {
							$customer['firstname'] = $this->request->post['firstname'];
						}
						if (!empty($this->request->post['lastname'])) {
							$customer['lastname'] = $this->request->post['lastname'];
						}
						if (!empty($this->session->data['language'])) {
							$customer['language'] = $this->session->data['language'];
						}
						$customer = json_encode($customer);
						$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `customer_info`='".$this->db->escape($customer)."', `restore_id`='".$this->request->post['email']."' WHERE `restore_id`='$id'");
						$this->session->data['abanonedCart_ID']=$this->request->post['email'];
					}
				}
			}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file>
	
	<file name="catalog/controller/checkout/register.php">
		<operation>
			<search position="before"><![CDATA[$this->response->setOutput(json_encode($json));]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
			$this->load->model('module/abandonedcarts');
			$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
			if (isset($abandonedCartsSettings['AbandonedCarts']['Enabled']) && $abandonedCartsSettings['AbandonedCarts']['Enabled']=='yes') { 
				$cart = $this->cart->getProducts();
				$cart = (!empty($cart)) ? $cart : '';
				
				if (!empty($cart)) {
					if ($this->customer->isLogged()) {
						$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
					} else {
						$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
					}
					$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
					
					if (empty($exists->row['customer'])) { 
						$customer = array(); 
					
						if (!empty($this->request->post['telephone'])) {
							$customer['telephone'] = $this->request->post['telephone'];
						}
						if (!empty($this->request->post['email'])) {
							$customer['email'] = $this->request->post['email'];
						}
						if (!empty($this->request->post['firstname'])) {
							$customer['firstname'] = $this->request->post['firstname'];
						}
						if (!empty($this->request->post['lastname'])) {
							$customer['lastname'] = $this->request->post['lastname'];
						}
						if (!empty($this->session->data['language'])) {
							$customer['language'] = $this->session->data['language'];
						}
						$customer = json_encode($customer);
						$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `customer_info`='".$this->db->escape($customer)."', `restore_id`='".$this->request->post['email']."' WHERE `restore_id`='$id'");
						$this->session->data['abanonedCart_ID']=$this->request->post['email'];
					}
				}
			}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file>
	
	<file name="catalog/controller/account/logout.php">
		<operation>
			<search position="before"><![CDATA[unset($this->session->data['wishlist']);]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
			$this->load->model('module/abandonedcarts');
			$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
			if (isset($abandonedCartsSettings['AbandonedCarts']['Enabled']) && $abandonedCartsSettings['AbandonedCarts']['Enabled']=='yes') { 
				if (!empty($this->session->data['abanonedCart_ID'])) {
					$this->session->data['abanonedCart_ID'] = '';
				}
			}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file> 
	
	<file name="catalog/controller/account/login.php">
		<operation>
			<search position="after"><![CDATA[if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {]]></search>
				<add><![CDATA[
					/* AbandonedCarts - Begin */
					$this->load->model('module/abandonedcarts');
					$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
					if (isset($abandonedCartsSettings['AbandonedCarts']['Enabled']) && $abandonedCartsSettings['AbandonedCarts']['Enabled']=='yes') { 
						$cart = $this->cart->getProducts();
						$cart = (!empty($cart)) ? $cart : '';
						
						if (!empty($cart)) {
							if ($this->customer->isLogged()) {
								$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
							} else {
								$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
							}
							$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
							
							if (empty($exists->row['customer'])) { 
								$customer = array(
										'id'=> $this->customer->getId(), 
										'email' => $this->customer->getEmail(),		
										'telephone' => $this->customer->getTelephone(),
										'firstname' => $this->customer->getFirstName(),
										'lastname' => $this->customer->getLastName(),
										'language' => $this->session->data['language']
								);
								$customer = json_encode($customer);
								$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `customer_info` = '".$this->db->escape($customer)."', `restore_id`='".$this->request->post['email']."' WHERE `restore_id`='$id'");
								$this->session->data['abanonedCart_ID']=$this->request->post['email'];
							}
						}
					}
					/* AbandonedCarts - End */
				]]></add>
		</operation>
	</file>
	
	<file name="catalog/controller/checkout/cart.php">
		<operation>
			<search position="after"><![CDATA[$this->cart->remove($this->request->get['remove']);]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
			$this->load->model('module/abandonedcarts');
			$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
			$abandonedCartsSettings = isset($abandonedCartsSettings['AbandonedCarts']) ? $abandonedCartsSettings['AbandonedCarts'] : array();
			if ($abandonedCartsSettings['Enabled']=='yes') {
				if ($this->customer->isLogged()) {
					$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
				} else {
					$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
				}
				$ABcart = $this->cart->getProducts();
				
				$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");

				if (!empty($exists->row) && empty($ABcart)) {
					$this->db->query("DELETE FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
					$this->session->data['abanonedCart_ID']=''; 
				} else if (!empty($exists->row) && !empty($ABcart))	{
					$cart = json_encode($ABcart);
					$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `cart` = '".$this->db->escape($cart)."', `date_modified`=NOW() WHERE `restore_id`='$id'");
				}
			}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file>
	
	<file name="catalog/controller/module/cart.php">
		<operation>
			<search position="after"><![CDATA[$this->cart->remove($this->request->get['remove']);]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
			$this->load->model('module/abandonedcarts');
			$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
			$abandonedCartsSettings = isset($abandonedCartsSettings['AbandonedCarts']) ? $abandonedCartsSettings['AbandonedCarts'] : array();
			if ($abandonedCartsSettings['Enabled']=='yes') {
				if ($this->customer->isLogged()) {
					$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
				} else {
					$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
				}
				$ABcart = $this->cart->getProducts();
				
				$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");

				if (!empty($exists->row) && empty($ABcart)) {
					$this->db->query("DELETE FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
					$this->session->data['abanonedCart_ID']=''; 
				} else if (!empty($exists->row) && !empty($ABcart))	{
					$cart = json_encode($ABcart);
					$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `cart` = '".$this->db->escape($cart)."', `date_modified`=NOW() WHERE `restore_id`='$id'");
				}
			}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file>   
	
	<file name="catalog/controller/checkout/cart.php">
		<operation>
			<search position="before"><![CDATA[public function index() {]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
				protected function register_abandonedCarts() {
					$ip = (!empty($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : '*HiddenIP*';
					if ($this->customer->isLogged()) {
						$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
					} else {
						$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
					}
					$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
					$cart = $this->cart->getProducts();
					$store_id = (int)$this->config->get('config_store_id');
					$cart = (!empty($cart)) ? $cart : '';
					
					$lastpage = "$_SERVER[REQUEST_URI]";
					
					$checker = $this->customer->getId();
					if (!empty($checker)) {
						$customer = array(
							'id'=> $this->customer->getId(), 
							'email' => $this->customer->getEmail(),		
							'telephone' => $this->customer->getTelephone(),
							'firstname' => $this->customer->getFirstName(),
							'lastname' => $this->customer->getLastName(),
							'language' => $this->session->data['language']
						);
					} 
					
					if (empty($exists->row)) {
						if (!empty($cart)) {
							if (!isset($customer)) {
								$customer = array(
									'language' => $this->session->data['language']
								);
							}
							$cart = json_encode($cart);
							$customer = (!empty($customer)) ? json_encode($customer) : '';
							$this->db->query("INSERT INTO `" . DB_PREFIX . "abandonedcarts` SET `cart`='".$this->db->escape($cart)."', `customer_info`='".$this->db->escape($customer)."', `last_page`='$lastpage', `ip`='$ip', `date_created`=NOW(), `date_modified`=NOW(), `restore_id`='".$id."', `store_id`='".$store_id."'");
							$this->session->data['abanonedCart_ID'] = $id;
						} 
					} else {
						if (!empty($cart)) {
							$cart = json_encode($cart);
							$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `cart` = '".$this->db->escape($cart)."', `last_page`='".$this->db->escape($lastpage)."', `date_modified`=NOW() WHERE `restore_id`='$id'");
						}
						if (isset($customer)) {
							$customer = json_encode($customer);
							$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `customer_info` = '".$this->db->escape($customer)."', `last_page`='".$this->db->escape($lastpage)."', `date_modified`=NOW() WHERE `restore_id`='$id'");
						}
					}
				}
			/* AbandonedCarts - End */
			]]>
			</add>
		</operation>
		
		<operation>
			<search position="after"><![CDATA[$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('checkout/cart'));]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
				$this->load->model('module/abandonedcarts');
				$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
				if (isset($abandonedCartsSettings['AbandonedCarts']['Enabled']) && $abandonedCartsSettings['AbandonedCarts']['Enabled']=='yes') { 
					$this->register_abandonedCarts();
				}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file>  
	
	<file name="catalog/model/checkout/order.php">
		<operation>
			<search position="after"><![CDATA[$order_id = $this->db->getLastId();]]></search>
			<add><![CDATA[
			/* AbandonedCarts - Begin */
			$this->load->model('module/abandonedcarts');
			$abandonedCartsSettings = $this->model_module_abandonedcarts->getSetting('AbandonedCarts', $this->config->get('store_id'));
			if (isset($abandonedCartsSettings['AbandonedCarts']['Enabled']) && $abandonedCartsSettings['AbandonedCarts']['Enabled']=='yes') { 
				if ($this->customer->isLogged()) {
					$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
				} else {
					$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();
				}
				$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
				if (!empty($exists->row)) {
					$this->db->query("DELETE FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
					$this->session->data['abanonedCart_ID']=''; 
				}
			}
			/* AbandonedCarts - End */
			]]></add>
		</operation>
	</file>
		<file name="catalog/controller/module/abandonedcarts.php">
		<operation>
			<search position="before"><![CDATA[private function getLanguages($data = array()) ]]></search>
			<add><![CDATA[
				public function getData() {
					//var_dump($_POST,$this->request->post['email']);
					$abandonedCartsSettings = $this->config->get('AbandonedCarts');

					if ($abandonedCartsSettings['Enabled']=='yes') {
						$cart = $this->cart->getProducts();
						$cart = (!empty($cart)) ? $cart : '';
						if (!empty($cart)) {
							if ($this->customer->isLogged()) {
								$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : $this->customer->getEmail();
							} else {
								$id = (!empty($this->session->data['abanonedCart_ID'])) ? $this->session->data['abanonedCart_ID'] : session_id();  
							}
							$exists = $this->db->query("SELECT * FROM `" . DB_PREFIX . "abandonedcarts` WHERE `restore_id` = '$id'");
							
							if (empty($exists->row['customer_info'])) { 
								$customer = array(); 
							
								if (isset($this->request->post['telephone'])) {
									$customer['telephone'] = $this->request->post['telephone'];
								} else {
									$customer['telephone'] = "";
								}
								if (isset($this->request->post['email'])) {
									$customer['email'] = $this->request->post['customer']['email'];
								} else {
									$customer['email'] = "";
								}
								if (isset($this->request->post['customer']['firstname'])) {
									$customer['firstname'] = $this->request->post['firstname'];
									
								} else {
									$customer['firstname'] = "";
								}
								if (isset($this->request->post['lastname'])) {
									$customer['lastname'] = $this->request->post['lastname'];
								} else {
									$customer['lastname'] = "";
								}
								if (!empty($this->session->data['language'])) {
									$customer['language'] = $this->session->data['language'];
								}
								$customer = json_encode($customer);
								$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `customer_info` = '".$this->db->escape($customer)."' WHERE `restore_id`='$id'");
							} else {
								$customer = json_decode($exists->row['customer_info'], true);
							
								if (isset($this->request->post['telephone'])) {
									$customer['telephone'] = $this->request->post['customer']['telephone'];
								}
								if (isset($this->request->post['email'])) {
									$customer['email'] = $this->request->post['email'];
								}
								if (isset($this->request->post['firstname'])) {
									$customer['firstname'] = $this->request->post['firstname'];
								}
								if (isset($this->request->post['lastname'])) {
									$customer['lastname'] = $this->request->post['lastname'];
								}
								$customer = json_encode($customer);
								$this->db->query("UPDATE `" . DB_PREFIX . "abandonedcarts` SET `customer_info` = '".$this->db->escape($customer)."' WHERE `restore_id`='$id'");
							}
							
						}
					}
				}
			]]></add>
		</operation>
	</file>
	
	
	
	
	<file name="catalog/view/theme/*/template/checkout/checkout.tpl">
	
		<operation>
			<search position="after"><![CDATA[<?php echo $content_bottom; ?></div>]]></search>
			<add><![CDATA[
				<!-- AbandonedCarts -->  
				<script>
				 
					  $(window).load(function() {
					  
						  var changeTimer = false;
						  $(document).on('change', '.checkout-content input[type=\'text\']', function() {
							
								var send_data = {};
								send_data[this.name] = this.value;
								$.ajax({
									url: 'index.php?route=module/abandonedcarts/getData',
									type: 'post',
									data:  send_data,
									dataType: 'html',
									success: function(html) {
										console.log("Success");
									},
									error: function() {
										console.log("Error");
									}
								});
							});
					  });
				</script>
				<!-- AbandonedCarts -->  
			]]></add>
		</operation>
	</file> 
</modification>