<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id>Enhanced E-Commerce Tracking</id>
	<version>2.2.1</version>
	<vqmver>2.3.0</vqmver>
	<author>VanStudio</author>
	<file error="skip" name="catalog/controller/common/header.php">
		<operation error="skip">
			<search position="after"><![CDATA[protected function index() {]]></search>
			<add><![CDATA[		$this->data['ee_js_position'] = $this->config->get('ee_tracking_js_position');
		$this->data['ee_js_version'] = $this->config->get('ee_tracking_js_version');]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/common/header.tpl">
		<operation error="skip">
			<search position="before"><![CDATA[</head>]]></search>
			<add><![CDATA[<?php if (isset($ee_js_position) && !$ee_js_position) { ?>
<script src="catalog/view/javascript/ee_tracking.min.js?eetv=2.2.1<?php echo isset($ee_js_version) ? '.' . $ee_js_version : ''; ?>" type="text/javascript"></script>
<?php } ?>]]></add>
		</operation>
		<operation error="skip">
			<search position="before"><![CDATA[<?php foreach ($scripts as $script) { ?>]]></search>
			<add><![CDATA[<?php if (isset($ee_js_position) && $ee_js_position == 1) { ?>
<script src="catalog/view/javascript/ee_tracking.min.js?eetv=2.2.1<?php echo isset($ee_js_version) ? '.' . $ee_js_version : ''; ?>" type="text/javascript"></script>
<?php } ?>]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/common/footer.php">
		<operation error="skip">
			<search position="after"><![CDATA[protected function index() {]]></search>
			<add><![CDATA[		$this->data['ee_js_position'] = $this->config->get('ee_tracking_js_position');
		$this->data['ee_js_version'] = $this->config->get('ee_tracking_js_version');]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/common/footer.tpl">
		<operation error="skip">
			<search position="after"><![CDATA[<div id="footer"]]></search>
			<add><![CDATA[<?php if (isset($ee_js_position) && $ee_js_position == 2) { ?>
<script src="catalog/view/javascript/ee_tracking.min.js?eetv=2.2.1<?php echo isset($ee_js_version) ? '.' . $ee_js_version : ''; ?>" type="text/javascript"></script>
<?php } ?>]]></add>
		</operation>
		<operation error="skip">
			<search position="before"><![CDATA[</body>]]></search>
			<add><![CDATA[<?php if (isset($ee_js_position) && $ee_js_position == 3) { ?>
<script src="catalog/view/javascript/ee_tracking.min.js?eetv=2.2.1<?php echo isset($ee_js_version) ? '.' . $ee_js_version : ''; ?>" type="text/javascript"></script>
<?php } ?>]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/product/product.php">
		<operation error="skip">
			<search position="after"><![CDATA[$results = $this->model_catalog_product->getProductRelated]]></search>
			<add><![CDATA[
			/** EET Module */
			$ee_position = 1;
			$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
			if ($this->data['ee_tracking']) {
				$this->data['ee_detail'] = $this->config->get('ee_tracking_detail_status');
				$this->data['ee_detail_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_detail_log') : false;
				$this->data['ee_click'] = $this->config->get('ee_tracking_click_status');
				$this->data['ee_click_log'] = $this->config->get('ee_tracking_click_log') ? $this->config->get('ee_tracking_click_log') : false;
				$this->data['ee_cart'] = $this->config->get('ee_tracking_cart_status');
				$this->data['ee_ga_callback'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_ga_callback') : 0;
				$this->data['ee_generate_cid'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_generate_cid') : 0;
				$this->data['ee_type'] = 'related';
				$ee_data = array('type' => $this->data['ee_type']);
				if ($results) {
					$this->data['ee_impression'] = $this->config->get('ee_tracking_impression_status');
					$this->data['ee_impression_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_impression_log') : false;
					$ee_data['position'] = $ee_position;
					foreach ($results as $item) {
						$ee_data['products'][] = $item['product_id'];
					}
					$this->data['ee_impression_data'] = json_encode($ee_data);
				} else {
					$this->data['ee_impression'] = false;
				}
				$this->data['ee_create_click'] = false;
				if ($this->data['ee_click'] && $this->config->get('ee_tracking_advanced_settings') && $this->config->get('ee_tracking_compatibility') && isset($this->request->server['HTTP_REFERER']) && $this->request->server['HTTP_REFERER']) {
					$this->data['ee_create_click'] = true;
					$this->data['ee_create_click_data'] = json_encode(array(
						'product_id' => $this->request->get['product_id'],
						'url'    => html_entity_decode($this->request->server['HTTP_REFERER'], ENT_QUOTES, 'UTF-8'),
					));
					if(isset($this->request->server['REQUEST_URI']) && strpos($this->request->server['HTTP_REFERER'], $this->request->server['REQUEST_URI']) !== false) {
						$this->data['ee_create_click'] = false;
					}
				}
			}
			/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="after"><![CDATA[$this->data['products'][] = array(]]></search>
			<add><![CDATA[					'ee_position' => isset($ee_position) ? $ee_position++ : '',]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/product/product.tpl">
		<operation error="skip">
			<search position="replace"><![CDATA[<?php echo $footer; ?>]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking) { ?>
<?php if ($ee_create_click) { ?>
<script type="text/javascript"><!--
  $(document).ready(function() {
    setIntervalEE(function() {
      if (!window.performance.navigation.type) {
        $.ajax({
          url: 'index.php?route=module/ee_tracking/createclick',
          type: 'post',
          data: JSON.parse('<?php echo $ee_create_click_data; ?>'),
          dataType: 'json',
          success: function(json) {
            if (json) {
              console.log(json);
            }
          },
        <?php if ($ee_click_log) { ?>
          error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/clicklog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
              console.log(logs);
            });
          }
        <?php } ?>
      });
      }
    }, <?php echo $ee_ga_callback ? $ee_ga_callback : 0; ?>, <?php echo $ee_generate_cid ? $ee_generate_cid : 0; ?>);
  });
  //--></script>
<?php } ?>
<?php if ($ee_detail) { ?>
<script type="text/javascript"><!--
  $(document).ready(function() {
    setIntervalEE(function() {
      $.ajax({
        url: 'index.php?route=module/ee_tracking/detail',
        type: 'post',
        data: { 'product_id': '<?php echo $product_id; ?>', 'url': window.location.href, 'title': document.title },
        dataType: 'json',
        success: function(json) {
          if (json) {
            console.log(json);
          }
        },
      <?php if ($ee_detail_log) { ?>
        error: function(xhr, exc, error) {
          $.post('index.php?route=module/ee_tracking/detaillog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
            console.log(logs);
          });
        }
      <?php } ?>
    });
    }, <?php echo $ee_ga_callback ? $ee_ga_callback : 0; ?>, <?php echo $ee_generate_cid ? $ee_generate_cid : 0; ?>);
  });
  //--></script>
<?php } ?>
<?php } ?>
<?php echo $footer; ?>
		]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/controller/product/" name="category.php,manufacturer.php,special.php,search.php">
		<operation error="skip">
			<search position="after"><![CDATA[$results = $this->model_catalog_product->getProduct]]></search>
			<add><![CDATA[
			/** EET Module */
			if (isset($page) && isset($limit)) {
				$ee_position = ($page - 1) * $limit + 1;
			} else {
				$ee_position = 1;
			}
			$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
			if ($this->data['ee_tracking'] && $results) {
				$this->data['ee_impression'] = $this->config->get('ee_tracking_impression_status');
				$this->data['ee_impression_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_impression_log') : false;
				$this->data['ee_click'] = $this->config->get('ee_tracking_click_status');
				$this->data['ee_cart'] = $this->config->get('ee_tracking_cart_status');
				$this->data['ee_ga_callback'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_ga_callback') : 0;
				$this->data['ee_generate_cid'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_generate_cid') : 0;
				$ee_class_array = preg_split('/(?=[A-Z])/', get_class($this));
				$this->data['ee_type'] = strtolower(array_pop($ee_class_array));
				$ee_data = array('type' => $this->data['ee_type']);
				$ee_data['position'] = $ee_position;
				foreach ($results as $item) {
					$ee_data['products'][] = $item['product_id'];
				}
				$this->data['ee_impression_data'] = json_encode($ee_data);
			}
			/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="after"><![CDATA[$this->data['products'][] = array(]]></search>
			<add><![CDATA[					'ee_position' => isset($ee_position) ? $ee_position++ : '',]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/product/compare.php">
		<operation error="skip">
			<search position="before"><![CDATA[foreach ($this->session->data['compare'] as $key => $product_id) {]]></search>
			<add><![CDATA[
		/** EET Module */
		$ee_position = 1;
		$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
		if ($this->data['ee_tracking'] && $this->session->data['compare']) {
			$this->data['ee_impression'] = $this->config->get('ee_tracking_impression_status');
			$this->data['ee_impression_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_impression_log') : false;
			$this->data['ee_click'] = $this->config->get('ee_tracking_click_status');
			$this->data['ee_cart'] = $this->config->get('ee_tracking_cart_status');
			$this->data['ee_ga_callback'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_ga_callback') : 0;
			$this->data['ee_generate_cid'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_generate_cid') : 0;
			$this->data['ee_type'] = 'compare';
			$ee_data = array('type' => $this->data['ee_type']);
			$ee_data['position'] = $ee_position;
			$ee_data['products'] = $this->session->data['compare'];
			$this->data['ee_impression_data'] = json_encode($ee_data);
		}
		/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="after"><![CDATA[$this->data['products'][$product_id] = array(]]></search>
			<add><![CDATA[					'ee_position'  => isset($ee_position) ? $ee_position++ : '',]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/view/theme/*/template/product/" name="product.tpl,category.tpl,manufacturer_info.tpl,special.tpl,search.tpl,compare.tpl">
		<operation error="skip">
			<search position="replace"><![CDATA[<?php echo $footer; ?>]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && isset($ee_impression) && $ee_impression) { ?>
<script type="text/javascript"><!--
  $(document).ready(function() {
    setIntervalEE(function() {
      var ee_data = JSON.parse('<?php echo $ee_impression_data; ?>');
      ee_data['url'] = window.location.href;
      ee_data['title'] = document.title;
      $.ajax({
        url: 'index.php?route=module/ee_tracking/listview',
        type: 'post',
        data: ee_data,
        dataType: 'json',
        success: function(json) {
          if (json) {
            console.log(json);
          }
        },
      <?php if ($ee_impression_log) { ?>
        error: function(xhr, exc, error) {
          $.post('index.php?route=module/ee_tracking/listviewlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
            console.log(logs);
          });
        }
      <?php } ?>
    });
    }, <?php echo $ee_ga_callback ? $ee_ga_callback : 0; ?>, <?php echo $ee_generate_cid ? $ee_generate_cid : 0; ?>);
  });
  //--></script>
<?php } ?>
<?php echo $footer; ?>
			]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[href="<?php echo $product['href']; ?>"]]></search>
			<add><![CDATA[href="<?php echo $product['href']; ?>" <?php if (isset($ee_tracking) && $ee_tracking && $ee_click) { ?>onclick="ee_product.click('<?php echo $product['product_id']; ?>', '<?php echo isset($product['ee_position']) ? $product['ee_position'] : ''; ?>', '<?php echo isset($ee_type) ? $ee_type : ''; ?>')"<?php } ?>]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[onclick="cart.add(]]></search>
			<add><![CDATA[<?php if (isset($ee_tracking) && $ee_tracking && $ee_cart) { ?>data-eet-position="<?php echo isset($product['ee_position']) ? $product['ee_position'] : ''; ?>" data-eet-type="<?php echo isset($ee_type) ? $ee_type : ''; ?>"<?php } ?> onclick="cart.add(]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[onclick="addToCart(]]></search>
			<add><![CDATA[<?php if (isset($ee_tracking) && $ee_tracking && $ee_cart) { ?>data-eet-position="<?php echo isset($product['ee_position']) ? $product['ee_position'] : ''; ?>" data-eet-type="<?php echo isset($ee_type) ? $ee_type : ''; ?>"<?php } ?> onclick="addToCart(]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/module/featured.php">
		<operation error="skip">
			<search position="before"><![CDATA[foreach ($products as $product_id) {]]></search>
			<add><![CDATA[
            /** EET Module */
			$ee_position = 1;
			$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
			if ($this->data['ee_tracking']) {
				$this->data['ee_impression'] = $this->config->get('ee_tracking_impression_status');
				$this->data['ee_impression_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_impression_log') : false;
				$this->data['ee_click'] = $this->config->get('ee_tracking_click_status');
				$this->data['ee_cart'] = $this->config->get('ee_tracking_cart_status');
				$this->data['ee_ga_callback'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_ga_callback') : 0;
				$this->data['ee_generate_cid'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_generate_cid') : 0;
				$this->data['ee_type'] = 'module_featured';
				$ee_data = array('type' => $this->data['ee_type']);
				foreach ($products as $product_id) {
					$ee_data['products'][] = $product_id;
				}
				$this->data['ee_impression_data'] = json_encode($ee_data);
			}
			/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="after"><![CDATA[$this->data['products'][] = array(]]></search>
			<add><![CDATA[					    'ee_position' => isset($ee_position) ? $ee_position++ : '',]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/controller/module/" name="bestseller.php,latest.php,special.php">
		<operation error="skip">
			<search position="before"><![CDATA[foreach ($results as $result) {]]></search>
			<add><![CDATA[
            /** EET Module */
			$ee_position = 1;
			$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
			if ($this->data['ee_tracking']) {
				$this->data['ee_impression'] = $this->config->get('ee_tracking_impression_status');
				$this->data['ee_impression_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_impression_log') : false;
				$this->data['ee_click'] = $this->config->get('ee_tracking_click_status');
				$this->data['ee_cart'] = $this->config->get('ee_tracking_cart_status');
				$this->data['ee_ga_callback'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_ga_callback') : 0;
				$this->data['ee_generate_cid'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_generate_cid') : 0;
				$ee_class_array = preg_split('/(?=[A-Z])/', get_class($this));
				$ee_class_name = array_pop($ee_class_array);
				$this->data['ee_type'] = 'module_' . strtolower($ee_class_name);
				$ee_data = array('type' => $this->data['ee_type']);
				foreach ($results as $result) {
					$ee_data['products'][] = $result['product_id'];
				}
				$this->data['ee_impression_data'] = json_encode($ee_data);
			}
			/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="after"><![CDATA[$this->data['products'][] = array(]]></search>
			<add><![CDATA[					'ee_position' => isset($ee_position) ? $ee_position++ : '',]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/view/theme/*/template/module/" name="bestseller.tpl,featured.tpl,latest.tpl,special.tpl">
		<operation error="skip">
			<search index="1" position="before"><![CDATA[<?php]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_impression) { ?>
<script type="text/javascript"><!--
  $(document).ready(function() {
    setIntervalEE(function() {
      var ee_data = JSON.parse('<?php echo $ee_impression_data; ?>');
      ee_data['url'] = window.location.href;
      ee_data['title'] = document.title;
      $.ajax({
        url: 'index.php?route=module/ee_tracking/listview',
        type: 'post',
        data: ee_data,
        dataType: 'json',
        success: function(json) {
          if (json) {
            console.log(json);
          }
        },
      <?php if ($ee_impression_log) { ?>
        error: function(xhr, exc, error) {
          $.post('index.php?route=module/ee_tracking/listviewlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
            console.log(logs);
          });
        }
      <?php } ?>
    });
    }, <?php echo $ee_ga_callback ? $ee_ga_callback : 0; ?>, <?php echo $ee_generate_cid ? $ee_generate_cid : 0; ?>);
  });
  //--></script>
<?php } ?>
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[href="<?php echo $product['href']; ?>"]]></search>
			<add><![CDATA[href="<?php echo $product['href']; ?>" <?php if (isset($ee_tracking) && $ee_tracking && $ee_click) { ?>onclick="ee_product.click('<?php echo $product['product_id']; ?>', '<?php echo isset($product['ee_position']) ? $product['ee_position'] : ''; ?>', '<?php echo isset($ee_type) ? $ee_type : ''; ?>')"<?php } ?>]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[onclick="cart.add(]]></search>
			<add><![CDATA[<?php if (isset($ee_tracking) && $ee_tracking && $ee_cart) { ?>data-eet-position="<?php echo isset($product['ee_position']) ? $product['ee_position'] : ''; ?>" data-eet-type="<?php echo isset($ee_type) ? $ee_type : ''; ?>"<?php } ?> onclick="cart.add(]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[onclick="addToCart(]]></search>
			<add><![CDATA[<?php if (isset($ee_tracking) && $ee_tracking && $ee_cart) { ?>data-eet-position="<?php echo isset($product['ee_position']) ? $product['ee_position'] : ''; ?>" data-eet-type="<?php echo isset($ee_type) ? $ee_type : ''; ?>"<?php } ?> onclick="addToCart(]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/controller/module/" name="banner.php,carousel.php,slideshow.php">
		<operation error="skip">
			<search position="before"><![CDATA[foreach ($results as $result) {]]></search>
			<add><![CDATA[
		/** EET Module */
		$ee_position = 1;
		$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
		if ($this->data['ee_tracking'] && $results) {
			$this->data['ee_promotion'] = $this->config->get('ee_tracking_promotion_status');
			$this->data['ee_promotion_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_promotion_log') : false;
			$this->data['ee_ga_callback'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_ga_callback') : 0;
			$this->data['ee_generate_cid'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_generate_cid') : 0;
			$this->data['ee_data'] = json_encode(array('banner_id' => $setting['banner_id']));
		}
		/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="after"><![CDATA[$this->data['banners'][] = array(]]></search>
			<add><![CDATA[					'ee_banner_id' => $result['banner_id'],
					'ee_position' => isset($ee_position) ? $ee_position++ : '',]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/view/theme/*/template/module/" name="banner.tpl,carousel.tpl,slideshow.tpl">
		<operation error="skip">
			<search index="1" position="before"><![CDATA[<?php]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && isset($ee_promotion) && $ee_promotion) { ?>
<script type="text/javascript"><!--
	$(document).ready(function() {
		setIntervalEE(function() {
			var ee_data = JSON.parse('<?php echo $ee_data; ?>');
			ee_data['url'] = window.location.href;
			ee_data['title'] = document.title;
			$.ajax({
				url: 'index.php?route=module/ee_tracking/promotion',
				type: 'post',
				data: ee_data,
				dataType: 'json',
				success: function(json) {
					if (json) {
						console.log(json);
					}
				},
			<?php if ($ee_promotion_log) { ?>
				error: function(xhr, exc, error) {
					$.post('index.php?route=module/ee_tracking/promotionlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
						console.log(logs);
					});
				}
			<?php } ?>
		});
		}, <?php echo $ee_ga_callback ? $ee_ga_callback : 0; ?>, <?php echo $ee_generate_cid ? $ee_generate_cid : 0; ?>);
	});
	//--></script>
<?php } ?>
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[href="<?php echo $banner['link']; ?>"]]></search>
			<add><![CDATA[href="<?php echo $banner['link']; ?>" <?php if (isset($ee_tracking) && $ee_tracking && $ee_promotion) { ?>onclick="ee_promotion.click('<?php echo isset($banner['ee_banner_id']) ? $banner['ee_banner_id'] : ''; ?>', '<?php echo isset($banner['ee_position']) ? $banner['ee_position'] : ''; ?>')"<?php } ?>]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/checkout/cart.php">
		<operation error="skip">
			<search position="after"><![CDATA[if (!empty($this->request->post['quantity'])) {]]></search>
			<add><![CDATA[
			/** EET Module */
			if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_cart_status')) {
				if (file_exists(DIR_APPLICATION . 'model/module/ee_tracking.php')) {
                    $this->load->model('module/ee_tracking');
					foreach ($this->request->post['quantity'] as $key => $value) {
						$product = explode(':', $key);
						if (!empty($product[1])) {
							$options = unserialize(base64_decode($product[1]));
						} else {
							$options = array();
						}
						if ($product) {
						 	$ee_data = array(
								'product_id' => isset($product[0]) ? $product[0] : '',
								'option' => $options,
								'url' => html_entity_decode($this->url->link('checkout/cart'), ENT_QUOTES, 'UTF-8'),
							);
							$quantity = isset($this->session->data['cart'][$key]) ? (int)$this->session->data['cart'][$key] : '';
							if ($value > $quantity) {
								$ee_data['quantity'] = $value - $quantity;
								$this->model_module_ee_tracking->addToCart($ee_data);
							} elseif ($value < $quantity) {
								$ee_data['quantity'] = $quantity - $value;
								$this->model_module_ee_tracking->removeFromCart($ee_data);
							}
						}
					}
				}
			}
			/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="before"><![CDATA[$this->cart->remove(]]></search>
			<add><![CDATA[
			/** EET Module */
            if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_cart_status')) {
				if (file_exists(DIR_APPLICATION . 'model/module/ee_tracking.php')) {
					$this->load->model('module/ee_tracking');
                    $product = explode(':', $this->request->get['remove']);
                    if (!empty($product[1])) {
                        $options = unserialize(base64_decode($product[1]));
                    } else {
                        $options = array();
                    }
					if ($product) {
						$ee_data = array(
							'product_id' => isset($product[0]) ? $product[0] : '',
							'quantity' => isset($this->session->data['cart'][$this->request->get['remove']]) ? (int)$this->session->data['cart'][$this->request->get['remove']] : '',
							'type' => 'cart',
							'option' => $options,
							);
						$this->model_module_ee_tracking->removeFromCart($ee_data);
					}
				}
			}
			/** EET Module */
            ]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/module/cart.php">
		<operation error="skip">
			<search position="before"><![CDATA[$this->cart->remove(]]></search>
			<add><![CDATA[
			/** EET Module */
            if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_cart_status')) {
				if (file_exists(DIR_APPLICATION . 'model/module/ee_tracking.php')) {
					$this->load->model('module/ee_tracking');
					$product = explode(':', $this->request->get['remove']);
					if (!empty($product[1])) {
						$options = unserialize(base64_decode($product[1]));
					} else {
						$options = array();
					}
					if ($product) {
						$ee_data = array(
							'product_id' => isset($product[0]) ? $product[0] : '',
							'quantity' => isset($this->session->data['cart'][$this->request->get['remove']]) ? (int)$this->session->data['cart'][$this->request->get['remove']] : '',
							'option' => $options,
							);
						$this->model_module_ee_tracking->removeFromCart($ee_data);
					}
				}
			}
			/** EET Module */
            ]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/checkout/checkout.php">
		<operation error="skip">
			<search position="after"><![CDATA[$products = $this->cart->getProducts();]]></search>
			<add><![CDATA[
		/** EET Module */
		$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
		if ($this->data['ee_tracking']) {
			$this->data['ee_checkout'] = $this->config->get('ee_tracking_checkout_status');
			$this->data['ee_checkout_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_checkout_log') : false;
			$this->data['ee_ga_callback'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_ga_callback') : 0;
			$this->data['ee_generate_cid'] = $this->config->get('ee_tracking_advanced_settings') ? $this->config->get('ee_tracking_generate_cid') : 0;
			$ee_data = array('step' => 1);
            $ee_checkout_guest = ($this->config->get('config_checkout_guest') && !$this->config->get('config_customer_price') && !$this->cart->hasDownload());
            if (!$this->customer->isLogged()) {
                if ($ee_checkout_guest && isset($this->session->data['account']) && $this->session->data['account'] == 'guest') {
					$ee_data['step_option'] = 'guest';
                } else {
					$ee_data['step_option'] = 'register';
                }
            } else {
				$ee_data['step_option'] = 'logged';
            }
			$this->data['ee_data'] = json_encode($ee_data);
		}
		/** EET Module */
            ]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/checkout/checkout.tpl">
		<operation error="skip">
			<search position="replace"><![CDATA[<?php echo $footer; ?>]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
<script type="text/javascript"><!--
    $(document).ready(function() {
        setIntervalEE(function() {
            var ee_data = JSON.parse('<?php echo $ee_data; ?>');
            ee_data['url'] = window.location.href;
            ee_data['title'] = document.title;
            $.ajax({
                url: 'index.php?route=module/ee_tracking/checkout',
                type: 'post',
                data: ee_data,
                dataType: 'json',
                success: function(json) {
                    if (json) {
                        console.log(json);
                    }
                },
            <?php if ($ee_checkout_log) { ?>
                error: function(xhr, exc, error) {
                    $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                        console.log(logs);
                    });
                }
            <?php } ?>
        });
        }, <?php echo $ee_ga_callback ? $ee_ga_callback : 0; ?>, <?php echo $ee_generate_cid ? $ee_generate_cid : 0; ?>);
    });
    //--></script>
<?php } ?>
<?php echo $footer; ?>
			]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/controller/checkout/" name="login.php,register.php,guest.php,payment_address.php,guest_shipping.php,shipping_address.php,confirm.php">
		<operation error="skip">
			<search position="after"><![CDATA[public function index() {]]></search>
			<add><![CDATA[
        /** EET Module */
		$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
		if ($this->data['ee_tracking']) {
			$this->data['ee_checkout'] = $this->config->get('ee_tracking_checkout_status');
			$this->data['ee_checkout_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_checkout_log') : false;
		}
		/** EET Module */
            ]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/checkout/login.tpl">
		<operation error="skip">
			<search><![CDATA[<?php if ($guest_checkout) { ?>]]></search>
			<add position="replace"><![CDATA[
    <?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
    <script type="text/javascript"><!--
      $(document).on('change', 'input[name="account"]', function() {
        $.ajax({
          url: 'index.php?route=module/ee_tracking/checkoutoption',
          type: 'post',
          data: { 'step': 1, 'step_option': $(this).val(), 'url': window.location.href, 'title': document.title },
          dataType: 'json',
          success: function(json) {
            if (json) {
              console.log(json);
            }
          },
        <?php if ($ee_checkout_log) { ?>
          error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
              console.log(logs);
            });
          }
        <?php } ?>
      });
      });
      //--></script>
    <?php } ?>
    <?php if ($guest_checkout) { ?>
			]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/view/theme/*/template/checkout/" name="register.tpl,guest.tpl">
		<operation error="skip">
			<search index="1" position="replace"><![CDATA[<script type="text/javascript">]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
<script type="text/javascript"><!--
    $.ajax({
        url: 'index.php?route=module/ee_tracking/checkout',
        type: 'post',
        data: { 'step': 2, 'step_option': 'new payment address', 'url': window.location.href, 'title': document.title  },
        dataType: 'json',
        success: function(json) {
            if (json) {
                console.log(json);
            }
        },
    <?php if ($ee_checkout_log) { ?>
        error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                console.log(logs);
            });
        }
    <?php } ?>
    });
    //--></script>
<?php } ?>
<script type="text/javascript">]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/checkout/payment_address.tpl">
		<operation error="skip">
			<search index="1" position="replace"><![CDATA[<script type="text/javascript">]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
<script type="text/javascript"><!--
    $.ajax({
        url: 'index.php?route=module/ee_tracking/checkout',
        type: 'post',
        data: { 'step': 2, 'step_option': 'existing payment address', 'url': window.location.href, 'title': document.title },
        dataType: 'json',
        success: function(json) {
            if (json) {
                console.log(json);
            }
        },
    <?php if ($ee_checkout_log) { ?>
        error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                console.log(logs);
            });
        }
    <?php } ?>
    });
    $(document).on('change', 'input[name="payment_address"]', function() {
        $.ajax({
            url: 'index.php?route=module/ee_tracking/checkoutoption',
            type: 'post',
            data: { 'step': 2, 'step_option': $(this).val() + ' payment address', 'url': window.location.href, 'title': document.title },
            dataType: 'json',
            success: function(json) {
                if (json) {
                    console.log(json);
                }
            },
        <?php if ($ee_checkout_log) { ?>
            error: function(xhr, exc, error) {
                $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                    console.log(logs);
                });
            }
        <?php } ?>
    });
    });
    //--></script>
<?php } ?>
<script type="text/javascript">]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/checkout/guest_shipping.tpl">
		<operation error="skip">
			<search index="1" position="replace"><![CDATA[<script type="text/javascript">]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
<script type="text/javascript"><!--
    $.ajax({
        url: 'index.php?route=module/ee_tracking/checkout',
        type: 'post',
        data: { 'step': 3, 'step_option': 'new shipping address', 'url': window.location.href, 'title': document.title },
        dataType: 'json',
        success: function(json) {
            if (json) {
                console.log(json);
            }
        },
    <?php if ($ee_checkout_log) { ?>
        error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                console.log(logs);
            });
        }
    <?php } ?>
    });
    $(document).on('change', 'input[name="shipping_address"]', function() {
        $.ajax({
            url: 'index.php?route=module/ee_tracking/checkoutoption',
            type: 'post',
            data: { 'step': 3, 'step_option': $(this).val() + ' shipping address', 'url': window.location.href, 'title': document.title },
            dataType: 'json',
            success: function(json) {
                if (json) {
                    console.log(json);
                }
            },
        <?php if ($ee_checkout_log) { ?>
            error: function(xhr, exc, error) {
                $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                    console.log(logs);
                });
            }
        <?php } ?>
    });
    });
    //--></script>
<?php } ?>
<script type="text/javascript">]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/checkout/shipping_address.tpl">
		<operation error="skip">
			<search index="1" position="replace"><![CDATA[<script type="text/javascript">]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
<script type="text/javascript"><!--
    $.ajax({
        url: 'index.php?route=module/ee_tracking/checkout',
        type: 'post',
        data: { 'step': 3, 'step_option': 'existing shipping address', 'url': window.location.href, 'title': document.title },
        dataType: 'json',
        success: function(json) {
            if (json) {
                console.log(json);
            }
        },
    <?php if ($ee_checkout_log) { ?>
        error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                console.log(logs);
            });
        }
    <?php } ?>
    });
    $(document).on('change', 'input[name="shipping_address"]', function() {
        $.ajax({
            url: 'index.php?route=module/ee_tracking/checkoutoption',
            type: 'post',
            data: { 'step': 3, 'step_option': $(this).val() + ' shipping address', 'url': window.location.href, 'title': document.title },
            dataType: 'json',
            success: function(json) {
                if (json) {
                    console.log(json);
                }
            },
        <?php if ($ee_checkout_log) { ?>
            error: function(xhr, exc, error) {
                $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                    console.log(logs);
                });
            }
        <?php } ?>
    });
    });
    //--></script>
<?php } ?>
<script type="text/javascript">]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/checkout/shipping_method.php">
		<operation error="skip">
			<search position="before"><![CDATA[$quote_data[$result['code']] = array(]]></search>
			<add><![CDATA[
            			/** EET Module */
						if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_checkout_status') && $this->config->get('ee_tracking_advanced_settings') && $this->config->get('ee_tracking_language_id') && isset($this->session->data['language'])) {
							$this->load->model('localisation/language');
							$this->load->model('module/ee_tracking');
							$ee_languages = $this->model_localisation_language->getLanguages();
							$ee_start_code = $this->session->data['language'];
							$language_info = $this->model_module_ee_tracking->getLanguageByCode($ee_start_code);
							foreach ($ee_languages as $ee_item) {
								if ($ee_item['language_id'] == $this->config->get('ee_tracking_language_id') && $ee_start_code != $ee_item['code']) {
									$ee_language = new Language($ee_item['directory']);
									$this->registry->set('language', $ee_language);
									$ee_quote = $this->{'model_shipping_' . $result['code']}->getQuote($shipping_address);
									foreach ($quote['quote'] as $key => $item2) {
										if (isset($ee_quote['quote'][$key]['title'])) {
											$quote['quote'][$key]['ee_title'] = $ee_quote['quote'][$key]['title'];
										}
									}
									$ee_language2 = new Language($language_info['directory']);
									$ee_language2->load($language_info['filename']);
									$ee_language2->load('checkout/checkout');
									$this->registry->set('language', $ee_language2);
								}
							}
						}
						/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="before"><![CDATA[if (isset($this->session->data['comment'])) {]]></search>
			<add><![CDATA[
		/** EET Module */
		$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
		if ($this->data['ee_tracking']) {
			$this->data['ee_checkout'] = $this->config->get('ee_tracking_checkout_status');
			$this->data['ee_checkout_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_checkout_log') : false;
			$ee_data = array('step_option' => 'No shipping methods available');
			if (isset($this->session->data['shipping_method']['code'])) {
				$ee_code = $this->session->data['shipping_method']['code'];
			} else {
				$ee_code = '';
			}
			if (isset($this->session->data['shipping_methods'])) {
				foreach ($this->session->data['shipping_methods'] as $key => $shipping_method) {
					if (!$shipping_method['error']) {
						foreach ($shipping_method['quote'] as $quote) {
							if ($quote['code'] == $ee_code || !$ee_code) {
								$ee_code = $quote['code'];
								if (isset($quote['ee_title'])) {
									$ee_data['step_option'] = htmlspecialchars($quote['ee_title'], ENT_QUOTES, 'UTF-8');
								} else {
									$ee_data['step_option'] = htmlspecialchars($quote['title'], ENT_QUOTES, 'UTF-8');
								}
							}
						}
					}
				}
			}
			$ee_data['step'] = 4;
			$this->data['ee_data'] = json_encode($ee_data);
		}
		/** EET Module */
            ]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/checkout/shipping_method.tpl">
		<operation error="skip">
			<search position="replace"><![CDATA[<?php if ($shipping_methods) {]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
<script type="text/javascript"><!--
    var ee_data = JSON.parse('<?php echo $ee_data; ?>');
    ee_data['url'] = window.location.href;
    ee_data['title'] = document.title;
    $.ajax({
        url: 'index.php?route=module/ee_tracking/checkout',
        type: 'post',
        data: ee_data,
        dataType: 'json',
        success: function(json) {
            if (json) {
                console.log(json);
            }
        },
    <?php if ($ee_checkout_log) { ?>
        error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                console.log(logs);
            });
        }
    <?php } ?>
    });
    $(document).on('change', 'input[name="shipping_method"]', function() {
        $.ajax({
            url: 'index.php?route=module/ee_tracking/checkoutoption',
            type: 'post',
            data: { 'step': 4, 'step_option': $(this).data('eet-name'), 'url': window.location.href, 'title': document.title },
            dataType: 'json',
            success: function(json) {
                if (json) {
                    console.log(json);
                }
            },
        <?php if ($ee_checkout_log) { ?>
            error: function(xhr, exc, error) {
                $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                    console.log(logs);
                });
            }
        <?php } ?>
    });
    });
    //--></script>
<?php } ?>
<?php if ($shipping_methods) {]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[value="<?php echo $quote['code']; ?>"]]></search>
			<add><![CDATA[<?php if (isset($ee_checkout) && $ee_checkout) { ?>data-eet-name="<?php echo isset($quote['ee_title']) ? htmlspecialchars($quote['ee_title']) : htmlspecialchars($quote['title']); ?>"<?php } ?> value="<?php echo $quote['code']; ?>"]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/checkout/payment_method.php">
		<operation error="skip">
			<search position="before"><![CDATA[if (isset($this->session->data['agree'])) {]]></search>
			<add><![CDATA[
		/** EET Module */
		$this->data['ee_tracking'] = $this->config->get('ee_tracking_status');
		if ($this->data['ee_tracking']) {
			$this->data['ee_checkout'] = $this->config->get('ee_tracking_checkout_status');
			$this->data['ee_checkout_log'] = $this->config->get('ee_tracking_log') ? $this->config->get('ee_tracking_checkout_log') : false;
			$ee_data = array('step_option' => 'No payment methods available');
			if (isset($this->session->data['payment_method']['code'])) {
				$ee_code = $this->session->data['payment_method']['code'];
			} else {
				$ee_code = '';
			}
			if (isset($this->session->data['payment_methods'])) {
				foreach ($this->session->data['payment_methods'] as $payment_method) {
					if ($payment_method['code'] == $ee_code || !$ee_code) {
						$ee_code = $payment_method['code'];
						if (isset($payment_method['ee_title'])) {
							$ee_data['step_option'] = htmlspecialchars($payment_method['ee_title'], ENT_QUOTES, 'UTF-8');
						} else {
							$ee_data['step_option'] = htmlspecialchars($payment_method['title'], ENT_QUOTES, 'UTF-8');
						}
					}
				}
			}
			$ee_data['step'] = 5;
			$this->data['ee_data'] = json_encode($ee_data);
		}
		/** EET Module */
            ]]></add>
		</operation>
		<operation error="skip">
			<search position="after"><![CDATA[if ($method) {]]></search>
			<add><![CDATA[
						/** EET Module */
						if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_checkout_status') && $this->config->get('ee_tracking_advanced_settings') && $this->config->get('ee_tracking_language_id') && isset($this->session->data['language']) && $this->session->data['language'] != $this->config->get('ee_tracking_language_id')) {
							$this->load->model('localisation/language');
							$ee_languages = $this->model_localisation_language->getLanguages();
							foreach ($ee_languages as $ee_item) {
								if ($ee_item['language_id'] == $this->config->get('ee_tracking_language_id')) {
									$language = new Language($ee_item['directory']);
									$language->load('payment/' . $result['code']);
									$method['ee_title'] = $language->get('text_title');
								}
							}
						}
						/** EET Module */
            ]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/checkout/payment_method.tpl">
		<operation error="skip">
			<search position="replace"><![CDATA[<?php if ($payment_methods) {]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
<script type="text/javascript"><!--
    var ee_data = JSON.parse('<?php echo $ee_data; ?>');
    ee_data['url'] = window.location.href;
    ee_data['title'] = document.title;
    $.ajax({
        url: 'index.php?route=module/ee_tracking/checkout',
        type: 'post',
        data: ee_data,
        dataType: 'json',
        success: function(json) {
            if (json) {
                console.log(json);
            }
        },
    <?php if ($ee_checkout_log) { ?>
        error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                console.log(logs);
            });
        }
    <?php } ?>
    });
    $(document).on('change', 'input[name="payment_method"]', function() {
        $.ajax({
            url: 'index.php?route=module/ee_tracking/checkoutoption',
            type: 'post',
            data: { 'step': 5, 'step_option': $(this).data('eet-name'), 'url': window.location.href, 'title': document.title },
            dataType: 'json',
            success: function(json) {
                if (json) {
                    console.log(json);
                }
            },
        <?php if ($ee_checkout_log) { ?>
            error: function(xhr, exc, error) {
                $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                    console.log(logs);
                });
            }
        <?php } ?>
    });
    });
    //--></script>
<?php } ?>
<?php if ($payment_methods) {]]></add>
		</operation>
		<operation error="skip">
			<search position="replace"><![CDATA[value="<?php echo $payment_method['code']; ?>"]]></search>
			<add><![CDATA[<?php if (isset($ee_checkout) && $ee_checkout) { ?>data-eet-name="<?php echo isset($payment_method['ee_title']) ? htmlspecialchars($payment_method['ee_title']) : htmlspecialchars($payment_method['title']); ?>"<?php } ?> value="<?php echo $payment_method['code']; ?>"]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/view/theme/*/template/checkout/confirm.tpl">
		<operation error="skip">
			<search position="replace"><![CDATA[<?php if (!isset($redirect)) { ?>]]></search>
			<add><![CDATA[
<?php if (isset($ee_tracking) && $ee_tracking && $ee_checkout) { ?>
<script type="text/javascript"><!--
    $.ajax({
        url: 'index.php?route=module/ee_tracking/checkout',
        type: 'post',
        data: { 'step': 6, 'step_option': 'confirm', 'url': window.location.href, 'title': document.title },
        dataType: 'json',
        success: function(json) {
            if (json) {
                console.log(json);
            }
        },
    <?php if ($ee_checkout_log) { ?>
        error: function(xhr, exc, error) {
            $.post('index.php?route=module/ee_tracking/checkoutlog', { 'error': error + ' (exc: ' + exc + ' status: ' + xhr.statusText + ')', 'url': window.location.href }, function( logs ) {
                console.log(logs);
            });
        }
    <?php } ?>
    });
    //--></script>
<?php } ?>
<?php if (!isset($redirect)) { ?>
        ]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/model/" name="checkout/order.php,d_quickcheckout/order.php">
		<operation error="skip">
			<search position="after"><![CDATA[$order_id = $this->db->getLastId();]]></search>
			<add><![CDATA[
        /** EET Module */
		if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_transaction_status') && file_exists(DIR_APPLICATION . 'model/module/ee_tracking.php')) {
			$this->load->model('module/ee_tracking');
			$this->model_module_ee_tracking->addOrderToClient($order_id);
		}
		/** EET Module */
        ]]></add>
		</operation>
		<operation error="skip">
			<search position="before"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "order_history]]></search>
			<add><![CDATA[
            /** EET Module */
			if (file_exists(DIR_APPLICATION . 'model/module/ee_tracking.php') && $this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_transaction_status') || $this->config->get('ee_tracking_refund_status')) {
				$this->load->model('module/ee_tracking');
				$this->model_module_ee_tracking->transaction($order_id, $order_status_id);
			}
			/** EET Module */
        ]]></add>
		</operation>
	</file>
	<file error="skip" name="admin/model/sale/order.php">
		<operation error="skip">
			<search position="after"><![CDATA[$order_id = $this->db->getLastId();]]></search>
			<add><![CDATA[
        /** EET Module */
		if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_transaction_status')) {
			$this->load->model('module/ee_tracking');
			$this->model_module_ee_tracking->addOrderToClient($order_id);
		}
		/** EET Module */
        ]]></add>
		</operation>
		<operation error="skip">
			<search position="before"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "order_history]]></search>
			<add><![CDATA[
            /** EET Module */
			if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_transaction_status') || $this->config->get('ee_tracking_refund_status')) {
				$curl = curl_init();
				if ($this->request->server['HTTP_USER_AGENT']) {
					curl_setopt($curl, CURLOPT_USERAGENT, $this->request->server['HTTP_USER_AGENT']);
				}
				curl_setopt($curl, CURLOPT_URL, HTTP_CATALOG . 'index.php?route=module/ee_tracking/transaction');
				curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded'));
				curl_setopt($curl, CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
				curl_setopt($curl, CURLOPT_HEADER, 0);
				curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
				curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
				curl_setopt($curl, CURLOPT_POST, 1);
				curl_setopt($curl, CURLOPT_POSTFIELDS, 'order_id=' . (int)$order_id . '&order_status_id=' . (int)$data['order_status_id'] . '&ni=1');
				curl_setopt($curl, CURLOPT_TIMEOUT, 30);
				curl_exec($curl);
				curl_close($curl);
			}
			/** EET Module */
        ]]></add>
		</operation>
	</file>
	<file error="skip" name="catalog/controller/account/return.php">
		<operation error="skip">
			<search position="after"><![CDATA[$this->model_account_return->addReturn($this->request->post);]]></search>
			<add><![CDATA[
			/** EET Module */
			if ($this->config->get('ee_tracking_status') && $this->config->get('ee_tracking_refund_status') && $this->config->get('ee_tracking_customer_refund') && isset($this->request->post['order_id'])) {
				$this->load->model('module/ee_tracking');
				$ee_data = array('order_id' => $this->request->post['order_id']);
				if (isset($this->request->get['product_id'])) {
					$ee_data['product_id'] = $this->request->get['product_id'];
					$ee_data['quantity'] = isset($this->request->post['quantity']) ? (int)$this->request->post['quantity'] : 1;
				} elseif (isset($this->request->post['model'])) {
					$ee_product_info = $this->model_module_ee_tracking->getProductByModel($this->request->post['model']);
					if ($ee_product_info) {
						$ee_data['product_id'] = $ee_product_info['product_id'];
						$ee_data['quantity'] = isset($this->request->post['quantity']) ? (int)$this->request->post['quantity'] : 1;
					}
				}
				$this->model_module_ee_tracking->refund($ee_data);
			}
			/** EET Module */
        ]]></add>
		</operation>
	</file>
	<file error="skip" name="admin/controller/module/ee_tracking.php">
		<operation error="skip">
			<search position="replace"><![CDATA[private $vqVersion = false;]]></search>
			<add><![CDATA[private $vqVersion = '2.2.1';]]></add>
		</operation>
	</file>
</modification>