<?xml version="1.0" encoding="UTF-8"?>
<modification>
  <id>Marketshop OpenCart Theme</id>
  <version>2.0</version>
  <vqmver>2.4.0</vqmver>
  <author>HarnishDesign.net</author>
  <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/category.php">
    <operation>
      <search position="after">
        <![CDATA[$product_total = $this->model_catalog_product->getTotalProducts($data);]]>
      </search>
      <add>
        <![CDATA[if(isset($result)){
    //code you want to exexute
    $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
    //end   
 }]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/product/category.php">
    <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/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>
  <file name="catalog/language/english/common/header.php">
    <operation>
      <search position="replace">
        <![CDATA[$_['text_welcome']        = 'Welcome visitor you can <a href="%s">login</a> or <a href="%s">create an account</a>.';]]>
      </search>
      <add>
        <![CDATA[$_['text_welcome']        = '<a href="%s">Login</a> <a href="%s">Register</a>';]]>
      </add>
    </operation>
  </file>
  <file name="catalog/language/english/common/header.php">
    <operation>
      <search position="replace">
        <![CDATA[$_['text_logged']         = 'You are logged in as <a href="%s">%s</a> <b>(</b> <a href="%s">Logout</a> <b>)</b>';]]>
      </search>
      <add>
        <![CDATA[$_['text_logged']         = '<a href="%s">%s</a> <a href="%s">Logout</a>';]]>
      </add>
    </operation>
  </file>
  <file path="catalog/controller/" name="module/featured.php,module/bestseller.php,module/latest.php,module/special.php,product/product.php">
    <operation>
      <search position="after">
        <![CDATA[$this->data['button_cart'] = $this->language->get('button_cart');]]>
      </search>
      <add>
        <![CDATA[$this->data['button_wishlist'] = $this->language->get('button_wishlist');		
          $this->data['button_compare'] = $this->language->get('button_compare');]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/product/product.php">
    <operation>
      <search position="after">
        <![CDATA[$this->data['heading_title'] = $product_info['name'];]]>
      </search>
      <add>
        <![CDATA[$this->data['direction'] = $this->language->get('direction');]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/common/header.php">
    <operation>
      <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';
					}			
			$this->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>
      <search position="replace">
        <![CDATA[$product_total = $this->model_catalog_product->getTotalProducts($data);]]>
      </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>
  </file>
  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="replace">
        <![CDATA['name'  => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),]]>
      </search>
      <add>
        <![CDATA['name'  => $child['name'],]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/common/header.php">
    <operation>
      <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>
  </file>
  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="after">
        <![CDATA[$this->data['text_checkout'] = $this->language->get('text_checkout');]]>
      </search>
      <add>
        <![CDATA[$this->data['text_order'] = $this->language->get('text_order');
          $this->data['text_newsletter'] = $this->language->get('text_newsletter');]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="after">
        <![CDATA[$this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');]]>
      </search>
      <add>
        <![CDATA[$this->data['order'] = $this->url->link('account/order', '', 'SSL');
          $this->data['newsletter'] = $this->url->link('account/newsletter', '', 'SSL');
		  $this->data['manufacturer'] = $this->url->link('product/manufacturer');]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="after">
        <![CDATA[$this->data['text_checkout'] = $this->language->get('text_checkout');]]>
      </search>
      <add>
        <![CDATA[$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
		$this->data['text_information'] = $this->language->get('text_information');
		$this->data['text_contact'] = $this->language->get('text_contact');
		$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->language->load('module/category');		
    	$this->data['heading_title'] = $this->language->get('heading_title');]]>
      </add>
    </operation>
  </file>
  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="after">
        <![CDATA[$this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');]]>
      </search>
      <add>
        <![CDATA[$this->load->model('catalog/information');
		$this->data['informations'] = array();
		foreach ($this->model_catalog_information->getInformations() as $result) {
			if ($result['bottom']) {
				$this->data['informations'][] = array(
					'title' => $result['title'],
					'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
				);
			}
    	}
		$this->data['contact'] = $this->url->link('information/contact');
		$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 path="catalog/controller/module/" name="featured.php,bestseller.php,special.php,latest.php">
    <operation>
      <search position="after">
        <![CDATA[$this->load->model('tool/image');]]>
      </search>
      <add>
        <![CDATA[$this->data['module'] = $setting;]]>
      </add>
    </operation>
  </file> 
	<file name="catalog/view/theme/*/template/product/product.tpl">
		<operation>
			<search position="replace"><![CDATA[<span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>]]></search>
			<add><![CDATA[<?php if ($product_info['quantity']<= 0) { ?>
        <span><?php echo $text_stock; ?></span><span style="color:#f00;"> <?php echo $stock; ?></span></div>
        <?php } else { ?>
        <span><?php echo $text_stock; ?></span><span style="color:#53af2e;"> <?php echo $stock; ?></span></div>
        <?php } ?>]]></add>
		</operation>
	</file>
	<file name="catalog/controller/product/product.php">
		<operation>
			<search position="after"><![CDATA[if ($product_info['quantity'] <= 0) {]]></search>
			<add><![CDATA[$this->data['product'] = $product_info['quantity'];]]></add>
		</operation>
		<operation><search position="after"><![CDATA[$product_info = $this->model_catalog_product->getProduct($product_id);]]></search>
		<add><![CDATA[$this->data['product_info'] = $product_info;]]></add>
		</operation>
	</file>
	
	
	<file path="catalog/view/theme/*/template/" name="account/*.tpl,affiliate/*.tpl,checkout/*.tpl,common/success.tpl,error/*.tpl,information/*.tpl,product/*.tpl">
		<operation>
			<search offset="4" position="replace"><![CDATA[<div class="breadcrumb">]]></search>
			<add><![CDATA[<ul class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
    <?php } ?>
  </ul>]]></add>
		</operation>
	</file>
	
	<file path="catalog/view/theme/*/template/" name="account/*.tpl,affiliate/*.tpl,checkout/*.tpl,common/success.tpl,common/home.tpl,error/*.tpl,information/*.tpl,product/*.tpl">
		<operation>
			<search position="replace"><![CDATA[<?php echo $column_left; ?><?php echo $column_right; ?>]]></search>
			<add><![CDATA[<div class="container">
<div class="row">
<?php echo $column_left; ?>
<?php if ($column_left && $column_right) { ?>
    <?php $class = 'col-lg-6 col-md-6 col-sm-6 col-xs-12'; ?>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class = 'col-lg-9 col-md-9 col-sm-9 col-xs-12'; ?>
    <?php } else { ?>
    <?php $class = 'col-lg-12 col-md-12 col-sm-12 col-xs-12'; ?>
    <?php } ?>]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[<div id="content">]]></search>
			<add><![CDATA[<div id="content" class="<?php echo $class; ?>">]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[<?php echo $content_bottom; ?></div>]]></search>
			<add><![CDATA[<?php echo $column_right; ?>
  </div></div>]]></add>
		</operation>
	</file>
	<file path="catalog/view/theme/*/template/" name="common/maintenance.tpl">
		<operation>
			<search position="replace"><![CDATA[<div id="content"><?php echo $message; ?></div>]]></search>
			<add><![CDATA[<div class="container">
<div class="row">
	<div id="content" class="col-lg-12 col-md-12 col-sm-12 col-xs-12"><?php echo $message; ?></div>
	</div></div>
	]]></add>
		</operation>
	</file>
	<file error="skip" path="catalog/view/theme/*/template/blog/" name="article.tpl,category.tpl">
		<operation>
			<search position="replace"><![CDATA[<?php echo $column_left; ?><?php echo $column_right; ?>]]></search>
			<add><![CDATA[<div class="container">
<div class="row">
<?php echo $column_left; ?>
<?php if ($column_left && $column_right) { ?>
    <?php $class = 'col-lg-6 col-md-6 col-sm-6 col-xs-12'; ?>
    <?php } elseif ($column_left || $column_right) { ?>
    <?php $class = 'col-lg-9 col-md-9 col-sm-9 col-xs-12'; ?>
    <?php } else { ?>
    <?php $class = 'col-lg-12 col-md-12 col-sm-12 col-xs-12'; ?>
    <?php } ?>]]></add>
		</operation>
		<operation>
			<search position="replace"><![CDATA[<div id="content">]]></search>
			<add><![CDATA[<div id="content" class="<?php echo $class; ?>">]]></add>
		</operation>
		<operation>
			<search position="before"><![CDATA[<?php echo $footer; ?>]]></search>
			<add><![CDATA[<?php echo $column_right; ?>
  </div></div>]]></add>
		</operation>
	</file>	
</modification>