<modification>
	<id>R.Gen OpenCart Theme</id>
	<version>1.0</version>
	<vqmver>2.3.1</vqmver>
	<author>R_GENESIS</author>
	
	<!-- 
	HEADER FILE
	***************************************************** -->
	<file name="catalog/controller/common/header.php">
		
		<!-- 
		MULTI LEVEL MENU
		***************************************************** -->
		<operation info="Multi level menu">
			
			<search position="after"><![CDATA[
			$product_total = $this->model_catalog_product->getTotalProducts($data);
			]]></search>
			
			<add><![CDATA[
			/*============*/
			$i = 0;
			$level1 = array();
			$ch1 = $this->model_catalog_category->getCategories($child['category_id']);
			foreach ($ch1 as $c1) {
				$d1 = array(
					'filter_category_id'  => $c1['category_id'],
					'filter_sub_category' => true
				);
				$p_total1 = $this->model_catalog_product->getTotalProducts($d1);

				$level1[] = array(
					'name'  => $c1['name'] . ($this->config->get('config_product_count') ? ' (' . $p_total1 . ')' : ''),
					'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'] . '_' . $c1['category_id'])
				);
				
				/*============*/
				
				$level2 = array();
				$ch2 = $this->model_catalog_category->getCategories($c1['category_id']);
				foreach ($ch2 as $c2) {
					$d2 = array(
						'filter_category_id'  => $c2['category_id'],
						'filter_sub_category' => true
					);
					$p_total2 = $this->model_catalog_product->getTotalProducts($d2);

					$level2[] = array(
						'name'  => $c2['name'] . ($this->config->get('config_product_count') ? ' (' . $p_total2 . ')' : ''),
						'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'] . '_' . $c1['category_id'] . '_' . $c2['category_id'])
					);
				}
				/*============*/
				if ($level2) {
				$level1[$i++] = array(
					'level2' => $level2,
					'name'  => $c1['name'] . ($this->config->get('config_product_count') ? ' (' . $p_total1 . ')' : ''),
					'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'] . '_' . $c1['category_id'])
				);
				}
			}
			/*============*/
			]]></add>
		</operation>
		<operation info="Multi level menu">
			<search position="after"><![CDATA[
			$children_data[] = array(
			]]></search>
			
			<add><![CDATA[
			'level1' => $level1,
			]]></add>
		</operation>
		<operation info="Multi level menu">
			<search position="after"><![CDATA[
			'name'     => $category['name'],
			]]></search>
			
			<add><![CDATA[
			'children' => $children_data,
			]]></add>
		</operation>
		
		<!-- 
		THIS RGEN THEME OPERATION
		***************************************************** -->
		<operation info="RGen theme data">
			<search position="before"><![CDATA[
			$this->render();
			]]></search>
			
			<add><![CDATA[
			/* RGen data
			******************************/
			$this->children[] = 'module/rgen_theme';

			$this->data['text_account'] = $this->language->get('text_account');
			$this->data['text_order'] = $this->language->get('text_order');
			$this->data['text_newsletter'] = $this->language->get('text_newsletter');

			$this->data['account'] = $this->url->link('account/account', '', 'SSL');
			$this->data['order'] = $this->url->link('account/order', '', 'SSL');
			$this->data['newsletter'] = $this->url->link('account/newsletter', '', 'SSL');
			
			]]></add>
		</operation>
		
	</file>
	<file name="catalog/controller/common/footer.php">
		<!-- 
		THIS RGEN THEME OPERATION
		***************************************************** -->
		<operation info="RGen theme data">
			<search position="before"><![CDATA[
			$this->render();
			]]></search>
			
			<add><![CDATA[
			/* RGen data
			******************************/
			$this->load->model('design/layout');
			$this->data ['getRoute'] = 'common/home';
			if (isset($this->request->get['route'])) {
				$this->data ['getRoute'] = $this->request->get['route'];
			} else {
				$this->data ['getRoute'] = 'common/home';
			}
			
			$this->children[] = 'module/rgen_theme';
			
			]]></add>
		</operation>
	</file>
	<file path="catalog/controller/module/" name="bestseller.php,featured.php,latest.php,special.php">
		<!-- 
		THIS RGEN THEME OPERATION
		***************************************************** -->
		<operation info="RGen theme data">
			<search position="before"><![CDATA[
			$this->render();
			]]></search>
			
			<add><![CDATA[
			/* RGen data
			******************************/
			static $module = 0;
        	$this->data['module'] = $module++;
        	$this->data['position'] = $setting['position'];
			
			]]></add>
		</operation>



	</file>
	<file name="catalog/controller/product/category.php">
		<!-- 
		THIS RGEN THEME OPERATION
		***************************************************** -->
		<operation info="RGen theme data">
			<search position="before"><![CDATA[
			$this->data['products'] = array();
			]]></search>
			
			<add><![CDATA[
			$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.touchSwipe.min.js');
        	$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.carouFredSel-6.1.0-packed.js');
        	
			/* RGen data
			******************************/
			$i = 0;
            foreach ($results as $result) {
                $this->data['categories'][$i++]['pic'] = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
            }
			
			]]></add>
		</operation>
	</file>
	<file name="catalog/controller/product/product.php">
		<!-- 
		THIS RGEN THEME OPERATION
		***************************************************** -->
		<operation info="RGen theme data">
			<search position="after"><![CDATA[
			public function index() {
			]]></search>
			
			<add><![CDATA[
			/* RGen data
			******************************/
			//$this->document->addScript('catalog/view/theme/rgen-opencart/js/cloud-zoom.1.0.2.min.js');
			//$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.jscrollpane.min.js');
			//$this->document->addStyle('catalog/view/theme/rgen-opencart/stylesheet/scrollpane.css');
			//$this->document->addStyle('catalog/view/theme/rgen-opencart/stylesheet/cloud-zoom.css');

			$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.elevateZoom-2.5.5.js');
			$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.magnific-popup.min.js');
			$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.touchSwipe.min.js');
			$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.carouFredSel-6.1.0-packed.js');
			$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.mCustomScrollbar.min.js');
			$this->document->addScript('catalog/view/theme/rgen-opencart/js/jquery.mousewheel.min.js');
			
			$this->document->addStyle('catalog/view/theme/rgen-opencart/stylesheet/jquery.mCustomScrollbar.css');
			$this->document->addStyle('catalog/view/theme/rgen-opencart/stylesheet/magnific-popup.css');
			
			]]></add>
		</operation>
		<operation info="RGen theme data">
			<search position="before"><![CDATA[
			$this->data['images'] = array();
			]]></search>
			
			<add><![CDATA[
			/* RGen data
			******************************/
			if ($product_info['image']) {
                $this->data['additional'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'));
            } else {
                $this->data['additional'] = '';
            }
			
			]]></add>
		</operation>
		<operation info="RGen theme data">
			<search position="before"><![CDATA[
			'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
			]]></search>
			
			<add><![CDATA[
			/* RGen data
			******************************/
			'thumb1' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height')),
			
			]]></add>
		</operation>
	</file>
</modification>