<?xml version="1.0" encoding="utf-8"?>
<modification>
    <code>oc_customize_template</code>
    <name>OC Customize Template</name>
    <version>3.x</version>
    <author>Plaza Theme</author>
	
	<file path="admin/model/localisation/language.php">
		<operation>
			<search><![CDATA[return $language_id;]]></search>
			<add position="before"><![CDATA[
				$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "cmsblock_description WHERE language_id = '" . (int)$this->config->get('config_language_id') . "'");

				foreach ($query->rows as $cmsblock_description) {
					$this->db->query("INSERT INTO " . DB_PREFIX . "cmsblock_description SET cmsblock_des_id = '" . (int)$cmsblock_description['cmsblock_des_id'] . "', language_id = '" . (int)$language_id . "', cmsblock_id = '" . (int)$cmsblock_description['cmsblock_id'] . "', title = '" . $this->db->escape($cmsblock_description['title']) . "', description = '" . $this->db->escape($cmsblock_description['description']) . "'");
				}
				$this->cache->delete('cmsblock_description');

				$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "article_description WHERE language_id = '" . (int)$this->config->get('config_language_id') . "'");

				foreach ($query->rows as $article_description) {
					$this->db->query("INSERT INTO " . DB_PREFIX . "article_description SET article_id = '" . (int)$article_description['article_id'] . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($article_description['name']) . "', description = '" . $this->db->escape($article_description['description']) . "', intro_text = '" . $this->db->escape($article_description['intro_text']) . "', meta_title = '" . $this->db->escape($article_description['meta_title']) . "', meta_description = '" . $this->db->escape($article_description['meta_description']) . "', meta_keyword = '" . $this->db->escape($article_description['meta_keyword']) . "'");
				}
				$this->cache->delete('article_description');
				
				$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "ocslideshow_image_description WHERE language_id = '" . (int)$this->config->get('config_language_id') . "'");

				foreach ($query->rows as $ocslideshow_image_description) {
					$this->db->query("INSERT INTO " . DB_PREFIX . "ocslideshow_image_description SET ocslideshow_image_id = '" . (int)$ocslideshow_image_description['ocslideshow_image_id'] . "', language_id = '" . (int)$language_id . "', ocslideshow_id = '" . (int)$ocslideshow_image_description['ocslideshow_id'] . "', description = '" . $this->db->escape($ocslideshow_image_description['description']) . "', title = '" . $this->db->escape($ocslideshow_image_description['title']) . "', sub_title = '" . $this->db->escape($ocslideshow_image_description['sub_title']) . "'");
				}
				$this->cache->delete('ocslideshow_image_description');
			]]></add>
		</operation>
	</file>

	<file path="catalog/controller/common/header.php">
		<operation>
			<search><![CDATA[return $this->load->view('common/header', $data);]]></search>
			<add position="before"><![CDATA[
				$data['block1'] = $this->load->controller('common/block1');
				$data['block2'] = $this->load->controller('common/block2');
				$data['block3'] = $this->load->controller('common/block3');
				$data['block9'] = $this->load->controller('common/block9');				
				$data['block8'] = $this->load->controller('common/block8');
				$data['block10'] = $this->load->controller('common/block10');		
				$data['block11'] = $this->load->controller('common/block11');	
				if($this->config->get('module_ocajaxlogin_status')){
					$data['use_ajax_login'] = true;
				}else{
					$data['use_ajax_login'] = false;
				}
				
				// For page specific css
				if (isset($this->request->get['route'])) {
					if (isset($this->request->get['product_id'])) {
						$class = '-' . $this->request->get['product_id'];
					} elseif (isset($this->request->get['path'])) {
						$class = '-' . $this->request->get['path'];
					} elseif (isset($this->request->get['manufacturer_id'])) {
						$class = '-' . $this->request->get['manufacturer_id'];
					} elseif (isset($this->request->get['information_id'])) {
						$class = '-' . $this->request->get['information_id'];
					} else {
						$class = '';
					}

					$data['class'] = str_replace('/', '-', $this->request->get['route']) . $class;
				} else {
					$data['class'] = 'common-home';
				}
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/controller/common/footer.php">
		<operation>
			<search><![CDATA[$data['newsletter'] = $this->url->link('account/newsletter', '', true);]]></search>
			<add position="after"><![CDATA[						
				$data['block4'] = $this->load->controller('common/block4');			
				$data['block5'] = $this->load->controller('common/block5');				
				$data['block6'] = $this->load->controller('common/block6');				
				$data['block7'] = $this->load->controller('common/block7');				
				$data['block8'] = $this->load->controller('common/block8');				
								
				if ($this->request->server['HTTPS']) {
					$server = $this->config->get('config_ssl');
				} else {
					$server = $this->config->get('config_url');
				}
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/controller/product/category.php">
		<operation>
			<search><![CDATA[foreach ($results as $result) {]]></search>
			<add position="before"><![CDATA[
				/* Get new product */
				$this->load->model('catalog/product');
		
				$data['new_products'] = array();
		
				$filter_data = array(
					'sort'  => 'p.date_added',
					'order' => 'DESC',
					'start' => 0,
					'limit' => 10
				);
		
				$new_results = $this->model_catalog_product->getProducts($filter_data);
				/* End */
			]]></add>
		</operation>
		<operation>
			<search><![CDATA[$data['products'][] = array(]]></search>
			<add position="before"><![CDATA[
				$is_new = false;
				if ($new_results) { 
					foreach($new_results as $new_r) {
						if($result['product_id'] == $new_r['product_id']) {
							$is_new = true;
						}
					}
				}
				if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
					$price_num = $this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$price_num = false;
				}

				if ((float)$result['special']) {
					$special_num = $this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$special_num = false;
				}
				/// Product Rotator /
				$store_id = $this->config->get('config_store_id');

				$product_rotator_status = (int) $this->config->get('module_octhemeoption_rotator')[$store_id];
				if($product_rotator_status == 1) {
				 $this->load->model('catalog/ocproductrotator');
				 $this->load->model('tool/image');
			 
				 $product_id = $result['product_id'];
				 $product_rotator_image = $this->model_catalog_ocproductrotator->getProductRotatorImage($product_id);
			 
				 if($product_rotator_image) {
				  $rotator_image = $this->model_tool_image->resize($product_rotator_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); 
				 } else {
				  $rotator_image = false;
				 } 
				} else {
				 $rotator_image = false;    
				}
				/// End Product Rotator /
								
				
			]]></add>
		</operation>
		<operation>
			<search><![CDATA['product_id'  => $result['product_id'],]]></search>
			<add position="before"><![CDATA[
				'is_new'      => $is_new,
				'rotator_image' => $rotator_image,
				'price_num'       => $price_num,
				'special_num'     => $special_num,
				'manufacturer' => $result['manufacturer'],
				'manufacturers' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id']),
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/controller/product/product.php">
		<operation>
			<search><![CDATA[$results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);]]></search>
			<add position="before"><![CDATA[
				/* Get new product */
				$this->load->model('catalog/product');
		
				$data['new_products'] = array();
		
				$filter_data = array(
					'sort'  => 'p.date_added',
					'order' => 'DESC',
					'start' => 0,
					'limit' => 10
				);
		
				$new_results = $this->model_catalog_product->getProducts($filter_data);
				/* End */
			]]></add>
		</operation>
		<operation>
			<search><![CDATA[$data['products'][] = array(]]></search>
			<add position="before"><![CDATA[
				$is_new = false;
				if ($new_results) { 
					foreach($new_results as $new_r) {
						if($result['product_id'] == $new_r['product_id']) {
							$is_new = true;
						}
					}
				}
				if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
					$price_num = $this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$price_num = false;
				}

				if ((float)$result['special']) {
					$special_num = $this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$special_num = false;
				}
				/// Product Rotator /
				$store_id = $this->config->get('config_store_id');

				$product_rotator_status = (int) $this->config->get('module_octhemeoption_rotator')[$store_id];
				if($product_rotator_status == 1) {
				 $this->load->model('catalog/ocproductrotator');
				 $this->load->model('tool/image');
			 
				 $product_id = $result['product_id'];
				 $product_rotator_image = $this->model_catalog_ocproductrotator->getProductRotatorImage($product_id);
			 
				 if($product_rotator_image) {
				  $rotator_image = $this->model_tool_image->resize($product_rotator_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); 
				 } else {
				  $rotator_image = false;
				 }
				} else {
				 $rotator_image = false;    
				}
				/// End Product Rotator /	
				
				$data['use_quickview'] = (int) $this->config->get('module_octhemeoption_quickview')[$store_id];
				
				
			]]></add>
		</operation>
		<operation>
			<search><![CDATA['rating'      => $rating,]]></search>
			<add position="after"><![CDATA[
				'is_new'      => $is_new,
				'rotator_image' => $rotator_image,
				'price_num'       => $price_num,
				'special_num'     => $special_num,
				'manufacturer' => $result['manufacturer'],
				'manufacturers' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id']),
			]]></add>
		</operation>
		<operation>
			<search><![CDATA[$data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');]]></search>
			<add position="after"><![CDATA[
				$data['short_description'] = utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..';
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/controller/product/special.php">		
		<operation>
			<search><![CDATA[$results = $this->model_catalog_product->getProductSpecials($filter_data);]]></search>
			<add position="after"><![CDATA[
				/* Get new product */
				$this->load->model('catalog/product');
		
				$data['new_products'] = array();
		
				$filter_data = array(
					'sort'  => 'p.date_added',
					'order' => 'DESC',
					'start' => 0,
					'limit' => 10
				);
		
				$new_results = $this->model_catalog_product->getProducts($filter_data);
				/* End */
			]]></add>
		</operation>
		
		<operation>
			<search><![CDATA[$data['products'][] = array(]]></search>
			<add position="before"><![CDATA[
				$is_new = false;
				if ($new_results) { 
					foreach($new_results as $new_r) {
						if($result['product_id'] == $new_r['product_id']) {
							$is_new = true;
						}
					}
				}
				if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
					$price_num = $this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$price_num = false;
				}

				if ((float)$result['special']) {
					$special_num = $this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$special_num = false;
				}
				/// Product Rotator /
				$store_id = $this->config->get('config_store_id');
				$product_rotator_status = (int) $this->config->get('module_octhemeoption_rotator')[$store_id];
				
				if($product_rotator_status == 1) {
				 $this->load->model('catalog/ocproductrotator');
				 $this->load->model('tool/image');
			 
				 $product_id = $result['product_id'];
				 $product_rotator_image = $this->model_catalog_ocproductrotator->getProductRotatorImage($product_id);
			 
					 if($product_rotator_image) {
							$rotator_image = $this->model_tool_image->resize($product_rotator_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); 
					} else {
						$rotator_image = false;
					}
				} else {
				 $rotator_image = false;    
				}
				/// End Product Rotator /
				
				
			]]></add>
		</operation>
		
		<operation>
			<search><![CDATA['rating'      => $result['rating'],]]></search>
			<add position="after"><![CDATA[
				'is_new'      => $is_new,
				'rotator_image' => $rotator_image,
				'price_num'       => $price_num,
				'special_num'     => $special_num,
				'manufacturer' => $result['manufacturer'],
				'manufacturers' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id']),
			]]></add>
		</operation>
	</file>

	<file path="catalog/controller/product/search.php">
		<operation>
			<search><![CDATA[$results = $this->model_catalog_product->getProducts($filter_data);]]></search>
			<add position="after"><![CDATA[
				/* Get new product */
				$this->load->model('catalog/product');
		
				$data['new_products'] = array();
		
				$filter_data = array(
					'sort'  => 'p.date_added',
					'order' => 'DESC',
					'start' => 0,
					'limit' => 10
				);
		
				$new_results = $this->model_catalog_product->getProducts($filter_data);
				/* End */
			]]></add>
		</operation>
		
		<operation>
			<search><![CDATA[$data['products'][] = array(]]></search>
			<add position="before"><![CDATA[
				$is_new = false;
				if ($new_results) { 
					foreach($new_results as $new_r) {
						if($result['product_id'] == $new_r['product_id']) {
							$is_new = true;
						}
					}
				}
				if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
					$price_num = $this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$price_num = false;
				}

				if ((float)$result['special']) {
					$special_num = $this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$special_num = false;
				}
				/// Product Rotator /
				$store_id = $this->config->get('config_store_id');
				$product_rotator_status = (int) $this->config->get('module_octhemeoption_rotator')[$store_id];
				if($product_rotator_status == 1) {
				 $this->load->model('catalog/ocproductrotator');
				 $this->load->model('tool/image');
			 
				 $product_id = $result['product_id'];
				 $product_rotator_image = $this->model_catalog_ocproductrotator->getProductRotatorImage($product_id);
			 
				 if($product_rotator_image) {
							$rotator_image = $this->model_tool_image->resize($product_rotator_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); 
					} else {
						$rotator_image = false;
					} 
				} else {
				 $rotator_image = false;    
				}
				/// End Product Rotator /
				
				
			]]></add>
		</operation>
		
		<operation>
			<search><![CDATA['rating'      => $result['rating'],]]></search>
			<add position="after"><![CDATA[
				'is_new'      => $is_new,
				'rotator_image' => $rotator_image,
				'price_num'       => $price_num,
				'special_num'     => $special_num,
				'manufacturer' => $result['manufacturer'],
				'manufacturers' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id']),
			]]></add>
		</operation>
	</file>

	<file path="catalog/controller/product/manufacturer.php">
		<operation>
			<search><![CDATA[$results = $this->model_catalog_product->getProducts($filter_data);]]></search>
			<add position="after"><![CDATA[
				/* Get new product */
				$this->load->model('catalog/product');
		
				$data['new_products'] = array();
		
				$filter_data = array(
					'sort'  => 'p.date_added',
					'order' => 'DESC',
					'start' => 0,
					'limit' => 10
				);
		
				$new_results = $this->model_catalog_product->getProducts($filter_data);
				/* End */
			]]></add>
		</operation>
		
		<operation>
			<search><![CDATA[$data['products'][] = array(]]></search>
			<add position="before"><![CDATA[
				$is_new = false;
				if ($new_results) { 
					foreach($new_results as $new_r) {
						if($result['product_id'] == $new_r['product_id']) {
							$is_new = true;
						}
					}
				}
				if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
					$price_num = $this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$price_num = false;
				}

				if ((float)$result['special']) {
					$special_num = $this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'));
				} else {
					$special_num = false;
				}
				/// Product Rotator /
				$store_id = $this->config->get('config_store_id');
				$product_rotator_status = (int) $this->config->get('module_octhemeoption_rotator')[$store_id];
				if($product_rotator_status == 1) {
				 $this->load->model('catalog/ocproductrotator');
				 $this->load->model('tool/image');
			 
				 $product_id = $result['product_id'];
				 $product_rotator_image = $this->model_catalog_ocproductrotator->getProductRotatorImage($product_id);
			 
				 if($product_rotator_image) {
							$rotator_image = $this->model_tool_image->resize($product_rotator_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); 
					} else {
						$rotator_image = false;
					}
				} else {
				 $rotator_image = false;    
				}
				/// End Product Rotator /
				
				
			]]></add>
		</operation>
		
		<operation>
			<search><![CDATA['rating'      => $result['rating'],]]></search>
			<add position="after"><![CDATA[
				'is_new'      => $is_new,
				'rotator_image' => $rotator_image,
				'price_num'       => $price_num,
				'special_num'     => $special_num,
				'manufacturer' => $result['manufacturer'],
				'manufacturers' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id']),
			]]></add>
		</operation>
	</file>
	<file path="catalog/controller/account/{account,address,affiliate,download,edit,forgotten,login,logout,newsletter,order,password,recurring,register,reset,return,reward,success,tracking,transaction,voucher,wishlist}*.php">
		  <operation>
		   <search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
		   <add position="after"><![CDATA[
			$data['heading_title'] = $this->language->get('heading_title');
		   ]]></add>
		  </operation>
		 </file>
		 
		 <file path="catalog/controller/affiliate/{login,register,success,}*.php">
		  <operation>
		   <search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
		   <add position="after"><![CDATA[
			$data['heading_title'] = $this->language->get('heading_title');
		   ]]></add>
		  </operation>
		 </file>
		 
		 <file path="catalog/controller/checkout/{cart,checkout,failure,success}*.php">
		  <operation>
		   <search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
		   <add position="after"><![CDATA[
			$data['heading_title'] = $this->language->get('heading_title');
		   ]]></add>
		  </operation>
		 </file>
		 
		 <file path="catalog/controller/product/{compare,manufacturer,search,special}*.php">
		  <operation>
		   <search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
		   <add position="after"><![CDATA[
			$data['heading_title'] = $this->language->get('heading_title');
		   ]]></add>
		  </operation>
		 </file>
		 
		 <file path="catalog/controller/{common,error}/{maintenance,not_found}*.php">
		  <operation>
		   <search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
		   <add position="after"><![CDATA[
			$data['heading_title'] = $this->language->get('heading_title');
		   ]]></add>
		  </operation>
		 </file>
		 
		 <file path="catalog/controller/extension/{credit_card,payment}/{sagepay_direct,sagepay_server,squareup,amazon_login_pay,klarna_checkout,wechat_pay}*.php">
		  <operation>
		   <search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
		   <add position="after"><![CDATA[
			$data['heading_title'] = $this->language->get('heading_title');
		   ]]></add>
		  </operation>
	</file>
	<file path="catalog/controller/information/{sitemap,contact}*.php">
	  <operation>
	   <search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
	   <add position="after"><![CDATA[
		$data['heading_title'] = $this->language->get('heading_title');
	   ]]></add>
	  </operation>
	 </file>
	 <file path="catalog/controller/account/{address,download,order,recurring,return,reward,transaction,wishlist}*.php">
		<operation>
			<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
			<add position="after"><![CDATA[
				$data['text_empty'] = $this->language->get('text_empty');
			]]></add>
		</operation>
	</file>
	<file path="catalog/controller/checkout/cart.php">
		<operation>
			<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
			<add position="after"><![CDATA[
				$data['text_empty'] = $this->language->get('text_empty');
			]]></add>
		</operation>
	</file>
	<file path="catalog/controller/common/cart.php">
		<operation>
			<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
			<add position="after"><![CDATA[
				$data['text_empty'] = $this->language->get('text_empty');
			]]></add>
		</operation>
	</file>
	<file path="catalog/controller/extension/credit_card/{sagepay_direct,sagepay_server}*.php">
		<operation>
			<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
			<add position="after"><![CDATA[
				$data['text_empty'] = $this->language->get('text_empty');
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/controller/product/{category,search}*.php">
		<operation>
			<search><![CDATA[$data['breadcrumbs'] = array();]]></search>
			<add position="before"><![CDATA[
				$data['text_empty'] = $this->language->get('text_empty');
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/controller/product/{compare,manufacturer,special}*.php">
		<operation>
			<search><![CDATA[$this->document->setTitle($this->language->get('heading_title'));]]></search>
			<add position="after"><![CDATA[
				$data['text_empty'] = $this->language->get('text_empty');
			]]></add>
		</operation>
	</file>
	<file path="catalog/controller/account/voucher.php">
		<operation>
			<search><![CDATA[$this->load->language('account/voucher');]]></search>
			<add position="after"><![CDATA[
				$data['text_agree'] = $this->language->get('text_agree');
			]]></add>
		</operation>
	</file>
	<file path="admin/controller/design/layout.php">
		<operation>
			<search><![CDATA[$this->load->language('design/layout');]]></search>
			<add position="after"><![CDATA[
				$data['heading_title'] = $this->language->get('heading_title');
			]]></add>
		</operation>
		<operation>
			<search><![CDATA[protected function getForm() {]]></search>
			<add position="after"><![CDATA[
				$this->load->language('design/layout');
				$data['heading_title'] = $this->language->get('heading_title');
			]]></add>
		</operation>
		
	</file>
</modification>