<?xml version="1.0" encoding="UTF-8"?>
<modification>
  <id>Marketshop OpenCart Theme</id>
  <version>2.0</version>
  <vqmver>2.X</vqmver>
  <author>HarnishDesign.net</author>
  <file name="catalog/controller/common/header.php">
    <operation info="For Top Menu Brands">
      <search position="after">
        <![CDATA[$this->load->model('catalog/product');]]>
      </search>
      <add>
        <![CDATA[$this->load->model('catalog/manufacturer');
		$this->load->model('tool/image');
		$results = $this->model_catalog_manufacturer->getManufacturers();
		foreach ($results as $result) {	
			if ($result['image']) {
						$image = $result['image'];
					} else {
						$image = 'no_image.jpg';
					}			
			$data['manufacturers'][] = array(
				'name' => $result['name'],
				'image' => $this->model_tool_image->resize($image, 60, 60),
				'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id'])
			);
		}]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/common/header.php">
    <operation info="For Top Menu 3rd Categories">
      <search position="before">
        <![CDATA[$children_data[] = array(]]>
      </search>
      <add>
        <![CDATA[$children_level2 = $this->model_catalog_category->getCategories($child['category_id']);
					$children_data_level2 = array();
					foreach ($children_level2 as $child_level2) {
							$data_level2 = array(
									'filter_category_id'  => $child_level2['category_id'],
									'filter_sub_category' => true
							);
							$product_total_level2 = '';
							//if ($this->config->get('config_product_count')) {
							//		$product_total_level2 = ' (' . $this->model_catalog_product->getTotalProducts($data_level2) . ')';
							//}

							$children_data_level2[] = array(
									'name'  =>  $child_level2['name'] . $product_total_level2,
									'href'  => $this->url->link('product/category', 'path=' . $category['category_id']. '_' . $child['category_id'] . '_' . $child_level2['category_id']),
									'id' => $category['category_id']. '_' . $child['category_id']. '_' . $child_level2['category_id']
							);
					}]]>
      </add>
    </operation>
	<operation info="For Top Menu 3rd Categories">
      <search position="replace">
        <![CDATA['name'  => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),]]>
      </search>
      <add>
        <![CDATA['name'  => $child['name'],]]>
      </add>
    </operation>
	<operation info="For Top Menu 3rd Categories">
      <search position="replace">
        <![CDATA['href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])]]>
      </search>
      <add>
        <![CDATA['href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']),
							'id' => $category['category_id']. '_' . $child['category_id'],
							'children_level2' => $children_data_level2,]]>
      </add>
    </operation>
	<operation>
      <search position="after">
        <![CDATA[$data['text_checkout'] = $this->language->get('text_checkout');]]>
      </search>
      <add>
        <![CDATA[$data['text_information'] = $this->language->get('text_information');
		$data['text_contact'] = $this->language->get('text_contact');
		$data['text_newsletter'] = $this->language->get('text_newsletter');
		]]>
      </add>
    </operation>
	<operation>
      <search position="after">
        <![CDATA[$data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');]]>
      </search>
      <add>
        <![CDATA[$this->load->model('catalog/information');
		$data['informations'] = array();
		foreach ($this->model_catalog_information->getInformations() as $result) {
			if ($result['bottom']) {
				$data['informations'][] = array(
					'title' => $result['title'],
					'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
				);
			}
    	}

		$data['manufacturer'] = $this->url->link('product/manufacturer');
		$data['newsletter'] = $this->url->link('account/newsletter', '', 'SSL');]]>
      </add>
    </operation>
	<operation info="For Remove autocomplet js from affiliate page">
      <search position="after">
        <![CDATA[$data['name'] = $this->config->get('config_name');]]>
      </search>
      <add>
        <![CDATA[$data['route'] = isset($this->request->get['route']) ? $this->request->get['route'] : 'common/home';]]>
      </add>
    </operation>
	<operation info="For Display Feature box in Only HomePage Header">
      <search position="after">
        <![CDATA[$data['name'] = $this->config->get('config_name');]]>
      </search>
      <add>
        <![CDATA[if (!isset($this->request->get['route']) || $this->request->get['route'] == 'common/home'){
$data['ishome']=1;
}]]>
      </add>
    </operation>
</file>
<file name="catalog/controller/common/footer.php">
<operation info="For Display Feature box in Only HomePage footer">
      <search position="after">
        <![CDATA[$this->load->model('catalog/information');]]>
      </search>
      <add>
        <![CDATA[if (!isset($this->request->get['route']) || $this->request->get['route'] == 'common/home'){
$data['ishome']=1;
}]]>
      </add>
    </operation>
	</file>
	
	<file name="catalog/controller/product/category.php">
    <operation info="For Refine Search Category page">
      <search position="before">
        <![CDATA[$data['categories'][] = array(]]>
      </search>
      <add>
        <![CDATA[if(isset($result)){
    $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
 }]]>
      </add>
    </operation>
	<operation>
      <search position="replace">
        <![CDATA['href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)]]>
      </search>
      <add>
        <![CDATA['href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url), 'thumb' => $image]]>
      </add>
    </operation>
  </file>
  <file name="catalog/view/theme/marketshop/template/product/category.tpl">
    <operation info="For add description class in product">
      <search position="replace">
        <![CDATA[<p><?php echo $product['description']; ?></p>]]>
      </search>
      <add>
        <![CDATA[<p class="description"><?php echo $product['description']; ?></p>]]>
      </add>
    </operation>
  </file>
  
  <!-- Product Saving in Percentage -->
  <file name="catalog/controller/module/featured.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $product_info['product_id'])]]>
      </search>
      <add>
        <![CDATA['href'    	 => $this->url->link('product/product', 'product_id=' . $product_info['product_id']),
          'saving' => $product_info['price'] == 0 ? 100 : round((($product_info['price'] - $product_info['special'])/$product_info['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/module/bestseller.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'])]]>
      </search>
      <add>
        <![CDATA['href'    	 => $this->url->link('product/product', 'product_id=' . $result['product_id']),
		  'saving' => $result['price'] == 0 ? 100 : round((($result['price'] - $result['special'])/$result['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/module/latest.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'])]]>
      </search>
      <add>
        <![CDATA['href'    	 => $this->url->link('product/product', 'product_id=' . $result['product_id']),
          'saving' => $result['price'] == 0 ? 100 : round((($result['price'] - $result['special'])/$result['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/module/special.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'])]]>
      </search>
      <add>
        <![CDATA['href'    	 => $this->url->link('product/product', 'product_id=' . $result['product_id']),
          'saving' => $result['price'] == 0 ? 100 : round((($result['price'] - $result['special'])/$result['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/product/category.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)]]>
      </search>
      <add>
        <![CDATA['href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url),
          'saving' => $result['price'] == 0 ? 100 : round((($result['price'] - $result['special'])/$result['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/product/manufacturer.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'manufacturer_id=' . $result['manufacturer_id'] . '&product_id=' . $result['product_id'] . $url)]]>
      </search>
      <add>
        <![CDATA['href'        => $this->url->link('product/product', 'manufacturer_id=' . $result['manufacturer_id'] . '&product_id=' . $result['product_id'] . $url),
          'saving' => $result['price'] == 0 ? 100 : round((($result['price'] - $result['special'])/$result['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/product/product.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'])]]>
      </search>
      <add>
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id']),
          'saving' => $result['price'] == 0 ? 100 : round((($result['price'] - $result['special'])/$result['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/product/search.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'] . $url)]]>
      </search>
      <add>
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'] . $url),
          'saving' => $result['price'] == 0 ? 100 : round((($result['price'] - $result['special'])/$result['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/product/special.php">
    <operation>
      <search position="replace">
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'] . $url)]]>
      </search>
      <add>
        <![CDATA['href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'] . $url),
          'saving' => $result['price'] == 0 ? 100 : round((($result['price'] - $result['special'])/$result['price'])*100, 0)]]>
      </add>
    </operation>
  </file>
  
  <!-- owl.carousel CSS & JS -->
  <file path="catalog/controller/module/" name="carousel.php,banner.php">
    <operation>
      <search position="replace">
        <![CDATA[$this->document->addStyle('catalog/view/javascript/jquery/owl-carousel/owl.carousel.css');]]>
      </search>
      <add>
        <![CDATA[$this->document->addStyle('catalog/view/theme/marketshop/stylesheet/owl.carousel.css');]]>
      </add>
    </operation>
  </file>
  
  <file path="catalog/controller/module/" name="featured.php,latest.php,bestseller.php,special.php,product.php">
    <operation>
      <search position="before">
        <![CDATA[$data['heading_title'] = $this->language->get('heading_title');]]>
      </search>
      <add>
        <![CDATA[$this->document->addStyle('catalog/view/theme/marketshop/stylesheet/owl.carousel.css');
		$this->document->addScript('catalog/view/javascript/jquery/owl-carousel/owl.carousel.min.js');
		]]>
      </add>
    </operation>
  </file>
  
  <file path="catalog/controller/module/" name="slideshow.php">
    <operation>
      <search index="1" position="replace">
        <![CDATA[$this->document->addStyle('catalog/view/javascript/jquery/owl-carousel/owl.carousel.css');]]>
      </search>
      <add>
        <![CDATA[$this->document->addStyle('catalog/view/theme/marketshop/stylesheet/owl.carousel.css');
		$this->document->addScript('catalog/view/javascript/jquery/owl-carousel/owl.carousel.min.js');
		$this->document->addStyle('catalog/view/theme/marketshop/stylesheet/slideshow.css');
		$this->document->addScript('catalog/view/theme/marketshop/js/jquery.nivo.slider.pack.js');
		]]>
      </add>
    </operation>
  </file>
  
  
  
  <file path="catalog/controller/product/" name="product.php">
    <operation>
      <search position="after" index="2">
        <![CDATA[foreach ($results as $result) {]]>
      </search>
      <add>
        <![CDATA[if ($result) {
				$this->document->addStyle('catalog/view/theme/marketshop/stylesheet/owl.carousel.css');
		$this->document->addScript('catalog/view/javascript/jquery/owl-carousel/owl.carousel.min.js');
			}
		]]>
      </add>
    </operation>
  </file>
  
  
  <!--<file path="catalog/controller/module/" name="featured.php">
    <operation>
      <search position="after">
        <![CDATA[$data['heading_title'] = $this->language->get('heading_title');]]>
      </search>
      <add>
        <![CDATA[$data['module'] = $setting;]]>
      </add>
    </operation>
  </file>
  <file path="catalog/controller/common/" name="content_top.php,content_bottom.php,content_right.php,content_left.php">
    <operation>
      <search position="after">
        <![CDATA[$setting_info = $this->model_extension_module->getModule($part[1]);]]>
      </search>
      <add>
        <![CDATA[$setting_info['position'] = basename(__FILE__, '.php');]]>
      </add>
    </operation>
  </file>-->
  
  <file name="catalog/controller/product/product.php">
    <operation>
      <search position="after">
        <![CDATA[$data['heading_title'] = $product_info['name'];]]>
      </search>
      <add>
        <![CDATA[$data['direction'] = $this->language->get('direction');]]>
      </add>
    </operation>
  </file>
  <file name="catalog/view/theme/*/template/product/product.tpl">
		<operation>
			<search position="replace"><![CDATA[<li><b><?php echo $text_stock; ?></b> <?php echo $stock; ?></li>]]></search>
			<add><![CDATA[<?php if ($product_info['quantity']<= 0) { ?>
			<li><b><?php echo $text_stock; ?></b> <span style="color:#f00; font-weight:bold;"><?php echo $stock; ?></span></li>
        <?php } else { ?>
		<li><b><?php echo $text_stock; ?></b> <span style="color:#53af2e; font-weight:bold;"><?php echo $stock; ?></span></li>
        <?php } ?>]]></add>
		</operation>
	</file>
	<file name="catalog/controller/product/product.php">
		<operation>
			<search position="after"><![CDATA[if ($product_info['quantity'] <= 0) {]]></search>
			<add><![CDATA[$data['product'] = $product_info['quantity'];]]></add>
		</operation>
		<operation><search position="after"><![CDATA[$product_info = $this->model_catalog_product->getProduct($product_id);]]></search>
		<add><![CDATA[$data['product_info'] = $product_info;]]></add>
		</operation>
	</file>
  
  
  
  
  
  
</modification>