<?xml version="1.0" encoding="utf-8"?>
<modification>
	<name><![CDATA[So Mobile]]></name>
	<code>so-mobile</code>
    <version><![CDATA[1.1.0]]></version>
    <author><![CDATA[OpenCartWorks]]></author>
	<link>http://www.opencartworks.com/</link>
	
	<!--========Catalog/controller/common=============-->
    <file path="catalog/controller/common/home.php">
		<operation  >
		<search ><![CDATA[$this->response->setOutput($this->load->view('common/home', $data));]]></search>
	    <add position="replace"><![CDATA[
	    	$soconfig 	= $this->soconfig;
			$platforms_mobile 		= $soconfig->get_settings('platforms_mobile');
		    if($this->session->data['device']=='mobile' && $platforms_mobile) $this->response->redirect($this->url->link('extension/mobile/home'));
		    else $this->response->setOutput($this->load->view('common/home', $data));
        ]]></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[
				$this->load->language('extension/soconfig/somobile');
				$data['menu_search'] = $this->url->link('product/search', '', true);
				$data['mobile'] = $this->soconfig;
				$http = $_SERVER["HTTPS"]  ? 'https://' : 'http://';
				$data['actual_link'] = $http."$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
				$data['text_items'] = sprintf($this->language->get('text_itemcount'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0));
				if($this->session->data['device']=='mobile'){
					$data['home'] = $this->url->link('extension/mobile/home');
				}else{
					$data['home'] = $this->url->link('common/home');
				}
				
		]]></add>
		</operation>
	</file>
	
	<file path="catalog/controller/common/footer.php">
		<operation>
			<search ><![CDATA[return $this->load->view('common/footer', $data); ]]></search>
			<add position="before"><![CDATA[
				// Menu Mobile
				//Decodes HTML Entities
         		$data['customfooter_text'] = html_entity_decode($data['soconfig']->get_settings('customfooter_text'), ENT_QUOTES, 'UTF-8');
			
			]]></add>
		</operation>
		
	</file>
	<!--End Catalog/controller/common-->
	
	<!--Catalog/controller/product-->
	<file path="catalog/controller/product/category.php">
		<operation>
			<search ><![CDATA[$data['heading_title'] = $category_info['name']]]></search>
			<add position="before"><![CDATA[$data['mobile'] =$this->soconfig;]]></add>
		</operation>
	</file>
	<file path="catalog/controller/product/{search,special,manufacturer}*.php">
		<operation>
			<search ><![CDATA[$this->load->model('tool/image')]]></search>
			<add position="after"><![CDATA[$data['mobile'] = $this->soconfig;]]></add>
		</operation> 
      
    </file>
	
	<!--End Catalog/controller/product-->
	
</modification>   