-- Table structure for table `oc_modification`
--

CREATE TABLE `oc_modification` (
  `modification_id` int(11) NOT NULL AUTO_INCREMENT,
  `extension_install_id` int(11) NOT NULL,
  `name` varchar(64) NOT NULL,
  `code` varchar(64) NOT NULL,
  `author` varchar(64) NOT NULL,
  `version` varchar(32) NOT NULL,
  `link` varchar(255) NOT NULL,
  `xml` mediumtext NOT NULL,
  `status` tinyint(1) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  PRIMARY KEY (`modification_id`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `oc_modification`
--

INSERT INTO `oc_modification` VALUES (1,0,'So Placeholder','ocmod-soplaceholder','OpencartWorks','1.0.0','http://www.OpencartWorks.com','<?xml version=\"1.0\" encoding=\"utf-8\"?> \r\n<modification> \r\n <name><![CDATA[So Placeholder]]></name> \r\n <code>ocmod-soplaceholder</code> \r\n <version><![CDATA[1.0.0]]></version> \r\n <author><![CDATA[OpencartWorks]]></author> \r\n <link>http://www.OpencartWorks.com</link> \r\n \r\n<!--========Catalog/controller/product=============--> \r\n <file path=\"catalog/controller/product/category.php\"> \r\n  <operation> \r\n	 <search><![CDATA[$image = $this->model_tool_image->resize(\'placeholder.png\', $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_product_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_product_height\'));]]></search> \r\n	 <add position=\"replace\"><![CDATA[$image = $this->model_tool_image->resize($placeholder, $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_product_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_product_height\'));]]></add> \r\n </operation>\r\n <operation > \r\n	 <search ><![CDATA[// Set the last category breadcrumb]]></search> \r\n	 <add position=\"before\"><![CDATA[ \r\n		$placeholder=\'placeholder.png\';\r\n		if($this->soconfig->get_settings(\'placeholder_status\')){\r\n			$placeholder = $this->soconfig->get_settings(\'placeholder_img\');\r\n		}else{\r\n			$placeholder = \'placeholder.png\';\r\n		}\r\n	 ]]> \r\n	 </add> \r\n </operation> \r\n  <operation > \r\n	 <search ><![CDATA[$data[\'thumb\'] = \'\';]]></search> \r\n	 <add position=\"replace\"><![CDATA[ \r\n		$data[\'thumb\'] = $this->model_tool_image->resize($placeholder, $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_category_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_category_height\'));\r\n	 ]]> \r\n	 </add> \r\n </operation>\r\n <operation > \r\n	 <search ><![CDATA[$data[\'categories\'][] ]]></search> \r\n	 <add position=\"before\"><![CDATA[ \r\n	 if ($result[\'image\']) $image = $this->model_tool_image->resize($result[\'image\'], $this->config->get(\'theme_\' .$this->config->get(\'config_theme\') . \'_image_category_width\'), $this->config->get(\'theme_\' .$this->config->get(\'config_theme\') . \'_image_category_height\')); \r\n	 else $image = $this->model_tool_image->resize($placeholder, $this->config->get(\'theme_\' .$this->config->get(\'config_theme\') . \'_image_category_width\'),$this->config->get( \'theme_\' .$this->config->get(\'config_theme\') . \'_image_category_height\')); \r\n	 ]]> \r\n	 </add> \r\n </operation> \r\n \r\n <operation> \r\n	 <search ><![CDATA[$data[\'categories\'][]]]></search> \r\n	 <add position=\"after\"><![CDATA[ \'thumb\' => $image,]]></add> \r\n </operation> \r\n \r\n\r\n \r\n </file> \r\n \r\n\r\n</modification> ',1,'2018-01-04 09:04:09','2018-01-04 09:04:13'),(2,0,'So ThemeConfig','ocmod-soconfig','OpenCartWorks','3.0.0','http://www.OpencartWorks.com','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n	<name><![CDATA[So ThemeConfig]]></name>\r\n	<code>ocmod-soconfig</code>\r\n    <version><![CDATA[3.0.0]]></version>\r\n    <author><![CDATA[OpenCartWorks]]></author>\r\n	<link>http://www.OpencartWorks.com</link>\r\n	\r\n<!--========Catalog/controller/common=============-->\r\n    <file path=\"catalog/controller/common/language.php\">\r\n		<operation>\r\n			<search ><![CDATA[$data[\'languages\'] = array();]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n			if (isset($this->request->get[\'lang\']) && $this->request->get[\'lang\'] == \'ar-ar\') {\r\n				$this->session->data[\'language\'] = $this->request->get[\'lang\'];\r\n				$this->response->redirect($this->url->link(\'common/home\'));\r\n			}\r\n		]]></add>\r\n		</operation>\r\n	</file>\r\n	\r\n	<file path=\"catalog/controller/common/cart.php\">\r\n		<operation >\r\n			<search ><![CDATA[public function index()]]></search>\r\n			<add position=\"after\" offset=\"2\"><![CDATA[\r\n		/*======Show Themeconfig=======*/\r\n		$this->load->language(\'extension/soconfig/cart\');\r\n		$data[\'objlang\'] = $this->language;\r\n		]]></add>\r\n		</operation>\r\n	</file>\r\n	\r\n	<file path=\"catalog/controller/common/header.php\">\r\n		<operation >\r\n			<search ><![CDATA[public function index()]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n		/*======Show Themeconfig=======*/\r\n		 $data[\'soconfig\'] = $this->soconfig; \r\n		 $this->load->language(\'extension/soconfig/compare\'); \r\n		 $data[\'objlang\'] = $this->language; \r\n		 $data[\'lang_id\'] = $this->config->get(\'config_language_id\'); \r\n		 $data[\'theme_directory\'] = $this->config->get(\'theme_default_directory\'); \r\n		 $data[\'url_layoutbox\'] = isset($this->request->get[\'layoutbox\']) ? $this->request->get[\'layoutbox\'] : \'\' ; \r\n		 $data[\'url_pattern\'] = isset($this->request->get[\'pattern\']) ? $this->request->get[\'pattern\'] : \'\' ; \r\n		 $data[\'account_fb\'] = isset($this->request->get[\'account_fb\']) ? $this->request->get[\'account_fb\'] : \'\' ; \r\n		 $data[\'compare\'] = $this->url->link(\'product/compare\', \'\', true); \r\n		\r\n		// add position\r\n		$data[\'content_menu1\'] = $this->load->controller(\'extension/soconfig/content_menu1\');\r\n		$data[\'content_menu2\'] = $this->load->controller(\'extension/soconfig/content_menu2\');\r\n		$data[\'header_block\'] = $this->load->controller(\'extension/soconfig/header_block\');\r\n		$data[\'search_block\'] = $this->load->controller(\'extension/soconfig/search_block\');\r\n		\r\n		// For page specific css\r\n		if (isset($this->request->get[\'route\'])) $data[\'class\'] = str_replace(\'/\', \'-\', $this->request->get[\'route\']);\r\n		else $data[\'class\'] = \'common-home\';\r\n		\r\n		//Decodes HTML Entities\r\n         $data[\'selector_body\'] = html_entity_decode($data[\'soconfig\']->get_settings(\'selector_body\'), ENT_QUOTES, \'UTF-8\');\r\n         $data[\'selector_menu\'] = html_entity_decode($data[\'soconfig\']->get_settings(\'selector_menu\'), ENT_QUOTES, \'UTF-8\');\r\n         $data[\'selector_heading\'] = html_entity_decode($data[\'soconfig\']->get_settings(\'selector_heading\'), ENT_QUOTES, \'UTF-8\');\r\n		$data[\'mselector_body\'] = html_entity_decode($data[\'soconfig\']->get_settings(\'mselector_body\'), ENT_QUOTES, \'UTF-8\');\r\n         $data[\'mselector_menu\'] = html_entity_decode($data[\'soconfig\']->get_settings(\'mselector_menu\'), ENT_QUOTES, \'UTF-8\');\r\n         $data[\'mselector_heading\'] = html_entity_decode($data[\'soconfig\']->get_settings(\'mselector_heading\'), ENT_QUOTES, \'UTF-8\');\r\n		\r\n		 if (!defined (\'OWL_CAROUSEL\')){ \r\n		 $this->document->addStyle(\'catalog/view/javascript/soconfig/css/owl.carousel.css\'); \r\n		 $this->document->addScript(\'catalog/view/javascript/soconfig/js/owl.carousel.js\'); \r\n		 define( \'OWL_CAROUSEL\', 1 ); \r\n		 } \r\n		]]></add>\r\n		</operation>\r\n	</file>\r\n	\r\n	<file path=\"catalog/controller/common/footer.php\">\r\n		<operation >\r\n			<search ><![CDATA[public function index()]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n		/*======Show Themeconfig=======*/\r\n		$data[\'soconfig\'] = $this->soconfig;\r\n		$this->load->language(\'extension/soconfig/soconfig\');\r\n		$data[\'objlang\'] = $this->language;\r\n		$data[\'lang_id\'] = $this->config->get(\'config_language_id\');\r\n		$data[\'theme_directory\'] = $this->config->get(\'theme_default_directory\');\r\n		$data[\'account_fb\'] = isset($this->request->get[\'account_fb\']) ? $this->request->get[\'account_fb\'] : \'\' ;\r\n		$data[\'compare\'] = $this->url->link(\'product/compare\', \'\', true);\r\n		$data[\'footer_block\'] = $this->load->controller(\'extension/soconfig/footer_block\');\r\n		// add position\r\n		if( $this->soconfig->get_settings(\'typefooter\') == 1) $data[\'footer_block1\'] = $this->load->controller(\'extension/soconfig/footer_block1\');\r\n		else if( $this->soconfig->get_settings(\'typefooter\') == 2) $data[\'footer_block2\'] = $this->load->controller(\'extension/soconfig/footer_block2\');\r\n	    else if( $this->soconfig->get_settings(\'typefooter\') == 3)  $data[\'footer_block3\'] = $this->load->controller(\'extension/soconfig/footer_block3\');\r\n	    else if( $this->soconfig->get_settings(\'typefooter\') == 4)  $data[\'footer_block4\'] = $this->load->controller(\'extension/soconfig/footer_block4\');\r\n	    else if( $this->soconfig->get_settings(\'typefooter\') == 5)  $data[\'footer_block5\'] = $this->load->controller(\'extension/soconfig/footer_block5\');\r\n	    else if( $this->soconfig->get_settings(\'typefooter\') == 6)  $data[\'footer_block6\'] = $this->load->controller(\'extension/soconfig/footer_block6\');\r\n	    else if( $this->soconfig->get_settings(\'typefooter\') == 7)  $data[\'footer_block7\'] = $this->load->controller(\'extension/soconfig/footer_block7\');\r\n	    else if( $this->soconfig->get_settings(\'typefooter\') == 8)  $data[\'footer_block8\'] = $this->load->controller(\'extension/soconfig/footer_block8\');\r\n		]]></add>\r\n		</operation>\r\n	</file>\r\n	<file path=\"catalog/controller/common/maintenance.php\">\r\n		<operation >\r\n			<search ><![CDATA[public function index()]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n				/*======Show Themeconfig=======*/\r\n				$this->load->language(\'extension/soconfig/soconfig\');\r\n				$data[\'objlang\'] = $this->language;\r\n				$data[\'soconfig\'] = $this->soconfig;\r\n				if ($this->request->server[\'HTTPS\']) $server = $this->config->get(\'config_ssl\');\r\n				else $server = $this->config->get(\'config_url\');\r\n				$data[\'config_logo\'] = $server.\'image/\'.$this->config->get(\'config_logo\');\r\n				$data[\'comingsoon_content\'] = html_entity_decode($data[\'soconfig\']->get_settings(\'comingsoon_content\'), ENT_QUOTES, \'UTF-8\');	\r\n                $data[\'content_comingsoon\'] = $this->load->controller(\'extension/soconfig/content_soon\');\r\n			]]></add>\r\n		</operation>\r\n       \r\n    </file>\r\n    <file path=\"catalog/controller/common/home.php\">\r\n		<operation >\r\n			<search ><![CDATA[$data[\'header\'] = $this->load->controller(\'common/header\');]]></search>\r\n			<add position=\"before\"><![CDATA[\r\n				$this->load->language(\'extension/soconfig/soconfig\');\r\n		        $data[\'objlang\'] = $this->language;\r\n			]]></add>\r\n		</operation>\r\n		\r\n	</file>\r\n	<file path=\"catalog/controller/common/home.php\">\r\n        <operation >\r\n         <search ><![CDATA[public function index()]]></search>\r\n         <add position=\"after\"><![CDATA[\r\n            $data[\'content_home\'] = $this->load->controller(\'extension/soconfig/content_home\');\r\n         ]]></add>\r\n        </operation>\r\n    </file>\r\n<!-- ==========catalog/controller/product=========-->\r\n	<file path=\"catalog/controller/product/{search,special,manufacturer,category}*.php\">\r\n	    <operation>\r\n			<search ><![CDATA[public function index()]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n        /*=======Show Themeconfig=======*/\r\n        $this->load->model(\'extension/soconfig/general\');\r\n        $this->load->language(\'extension/soconfig/soconfig\');\r\n        $data[\'objlang\'] = $this->language;\r\n        $data[\'soconfig\'] = $this->soconfig;\r\n        $data[\'theme_directory\'] = $this->config->get(\'theme_default_directory\');\r\n        $data[\'our_url\'] = $this->registry->get(\'url\');\r\n		/*=======url query parameters=======*/ \r\n		 $data[\'url_sidebarsticky\'] = isset($this->request->get[\'sidebarsticky\']) ? $this->request->get[\'sidebarsticky\'] : \'\' ; \r\n		 $data[\'url_cartinfo\'] = isset($this->request->get[\'cartinfo\']) ? $this->request->get[\'cartinfo\'] : \'\' ; \r\n		 $data[\'url_thumbgallery\'] = isset($this->request->get[\'thumbgallery\']) ? $this->request->get[\'thumbgallery\'] : \'\' ; \r\n		 $data[\'url_listview\'] = isset($this->request->get[\'listview\']) ? $this->request->get[\'listview\'] : \'\' ; \r\n		 $data[\'url_asidePosition\'] = isset($this->request->get[\'asidePosition\']) ? $this->request->get[\'asidePosition\'] : \'\' ; \r\n		 $data[\'url_asideType\'] = isset($this->request->get[\'asideType\']) ? $this->request->get[\'asideType\'] : \'\' ; \r\n		 $data[\'url_layoutbox\'] = isset($this->request->get[\'layoutbox\']) ? $this->request->get[\'layoutbox\'] : \'\' ; \r\n		]]></add>\r\n		</operation>\r\n		\r\n		<operation> \r\n		 <search ><![CDATA[$data[\'products\'][] = array(]]></search> \r\n		 <add position=\"before\"><![CDATA[ \r\n		 /*======Image Galleries=======*/ \r\n		 $data[\'image_galleries\'] = array(); \r\n		 $image_galleries = $this->model_catalog_product->getProductImages($result[\'product_id\']); \r\n		 foreach ($image_galleries as $image_gallery) { \r\n		 $data[\'image_galleries\'][] = array( \r\n		 \'cart\' => $this->model_tool_image->resize($image_gallery[\'image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_cart_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_cart_width\')), \r\n		 \'thumb\' => $this->model_tool_image->resize($image_gallery[\'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\')) \r\n		 ); \r\n		 } \r\n		 $data[\'first_gallery\'] = array( \r\n		 \'cart\' => $this->model_tool_image->resize($result[\'image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_cart_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_cart_width\')), \r\n		 \'thumb\' => $this->model_tool_image->resize($result[\'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\')) \r\n		 ); \r\n		 /*======Check New Label=======*/ \r\n		 if ((float)$result[\'special\']) $discount = \'-\'.round((($result[\'price\'] - $result[\'special\'])/$result[\'price\'])*100, 0).\'%\'; \r\n		 else $discount = false; \r\n		 \r\n		 $sold = 0; \r\n		 if($this->model_extension_soconfig_general->getUnitsSold($result[\'product_id\'])){ \r\n		 $sold = $this->model_extension_soconfig_general->getUnitsSold($result[\'product_id\']); \r\n		 } \r\n		 \r\n		 $data[\'orders\'] = sprintf($this->language->get(\'text_product_orders\'),$sold); \r\n		 $data[\'reviews\'] = sprintf($this->language->get(\'text_reviews\'), (int)$result[\'reviews\']); \r\n		 ]]></add> \r\n		 </operation> \r\n		 \r\n		<operation> \r\n		 <search><![CDATA[$data[\'products\'][] = array]]></search> \r\n		 <add position=\"after\" trim=\"true\" offset=\"2\"><![CDATA[ \r\n		 \'special_end_date\' => $this->model_extension_soconfig_general->getDateEnd($result[\'product_id\']), \r\n		 \'image_galleries\' => $data[\'image_galleries\'], \r\n		 \'first_gallery\' => $data[\'first_gallery\'], \r\n		 \'discount\' => $discount, \r\n		 \'stock_status\' => $result[\'stock_status\'], \r\n		 \'orders\' => $data[\'orders\'], \r\n		 \'reviews\' => $data[\'reviews\'], \r\n		 \'href_quickview\' => htmlspecialchars_decode($this->url->link(\'extension/soconfig/quickview&product_id=\'.$result[\'product_id\'] )), \r\n		 \'quantity\' => $result[\'quantity\'],]]></add> \r\n		 </operation> \r\n		\r\n	</file>\r\n	\r\n	<file path=\"catalog/controller/product/manufacturer.php\">\r\n	    <operation>\r\n			<search ><![CDATA[public function info()]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n            /*=======Show Themeconfig=======*/\r\n            $this->load->model(\'extension/soconfig/general\');\r\n            $this->load->language(\'extension/soconfig/soconfig\');\r\n            $data[\'objlang\'] = $this->language;\r\n            $data[\'soconfig\'] = $this->soconfig;\r\n            $data[\'theme_directory\'] = $this->config->get(\'theme_default_directory\');\r\n            $data[\'our_url\'] = $this->registry->get(\'url\');\r\n    		]]></add>\r\n		</operation>\r\n	</file>\r\n	<file path=\"catalog/controller/product/product.php\">\r\n	    <operation>\r\n			<search ><![CDATA[public function index()]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n            /*=======Show Themeconfig=======*/\r\n            $this->load->language(\'extension/soconfig/soconfig\');\r\n            $data[\'objlang\'] = $this->language;\r\n            $data[\'soconfig\'] = $this->soconfig;\r\n            $data[\'theme_directory\'] = $this->config->get(\'theme_default_directory\');\r\n            $data[\'our_url\'] = $this->registry->get(\'url\');\r\n          	$direction = $this->language->get(\'direction\');\r\n          	$data[\'direction\'] = $this->language->get(\'direction\') == \'rtl\' ? \'yes\' : \'no\' ;\r\n          	 /*=======url query parameters=======*/ \r\n			 $data[\'url_sidebarsticky\'] = isset($this->request->get[\'sidebarsticky\']) ? $this->request->get[\'sidebarsticky\'] : \'\' ; \r\n			 $data[\'url_productGallery\'] = isset($this->request->get[\'productGallery\']) ? $this->request->get[\'productGallery\'] : \'\' ; \r\n			 $data[\'url_asidePosition\'] = isset($this->request->get[\'asidePosition\']) ? $this->request->get[\'asidePosition\'] : \'\' ; \r\n			 $data[\'url_asideType\'] = isset($this->request->get[\'asideType\']) ? $this->request->get[\'asideType\'] : \'\' ; \r\n    		]]></add>\r\n		</operation>\r\n		<operation error=\"skip\">\r\n			<search ><![CDATA[$this->document->addScript(\'catalog/view/javascript/jquery/magnific/jquery.magnific-popup.min.js\');]]></search>\r\n			<add position=\"replace\"><![CDATA[\r\n				$this->document->addScript(\'catalog/view/javascript/soconfig/js/jquery.elevateZoom-3.0.8.min.js\');\r\n				$this->document->addScript(\'catalog/view/javascript/soconfig/js/jquery.sticky-kit.min.js\');\r\n				$this->document->addScript(\'catalog/view/javascript/soconfig/js/lightslider.js\');\r\n			]]></add>\r\n		</operation>\r\n\r\n		<operation error=\"skip\">\r\n			<search ><![CDATA[$this->document->addStyle(\'catalog/view/javascript/jquery/magnific/magnific-popup.css\');]]></search>\r\n			<add position=\"replace\"><![CDATA[$this->document->addStyle(\'catalog/view/javascript/soconfig/css/lightslider.css\');]]></add>\r\n		</operation>\r\n\r\n		<operation>\r\n			<search ><![CDATA[$data[\'description\'] = html_entity_decode($product_info[\'description\'], ENT_QUOTES, \'UTF-8\');]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n        		//custom code\r\n				$this->load->model(\'extension/soconfig/general\');\r\n	        	$data[\'special_end_date\'] = $this->model_extension_soconfig_general->getDateEnd($product_id);\r\n				$limit = 250;\r\n				$full_description =  html_entity_decode($product_info[\'description\'], ENT_QUOTES, \'UTF-8\');\r\n				$product_description_short = (strlen($full_description) > $limit ? utf8_substr($full_description, 0, $limit) . \'...\' : $full_description);\r\n				$data[\'description_short\'] = strip_tags($product_description_short);\r\n				//SEO Rich Snippets \r\n\r\nif ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\r\n$data[\'price_value\']=$this->tax->calculate($product_info[\'price\'], $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\r\n} else {\r\n$data[\'price_value\']=0;\r\n}\r\n\r\nif ((float)$product_info[\'special\']) {\r\n	$data[\'special_value\'] = $this->tax->calculate($product_info[\'special\'], $product_info[\'tax_class_id\'], $this->config->get(\'config_tax\'));\r\n} else {\r\n	$data[\'special_value\'] = false;\r\n}\r\n$data[\'currency\']=$this->session->data[\'currency\'];\r\n$data[\'count_reviews\']=(int)$product_info[\'reviews\'];\r\n    			]]></add>\r\n		</operation>\r\n\r\n		 <operation> \r\n		 <search ><![CDATA[$data[\'options\'] = array();]]></search> \r\n		 <add position=\"before\"><![CDATA[ \r\n		 if ((float)$product_info[\'special\']) $data[\'discount\'] = \'-\'.round((($product_info[\'price\'] - $product_info[\'special\'])/$product_info[\'price\'])*100, 0).\'%\'; \r\n		 else $data[\'discount\'] = false; \r\n		 /*======Check New Label=======*/ \r\n		 $sold = 0; \r\n		 if($this->model_extension_soconfig_general->getUnitsSold($product_info[\'product_id\'])){ \r\n		 $sold = $this->model_extension_soconfig_general->getUnitsSold($product_info[\'product_id\']); \r\n		 } \r\n\r\n		 $data[\'orders\'] = sprintf($this->language->get(\'text_product_orders\'),$sold); \r\n		 /*====== insert image to the beginning of array=======*/ \r\n		 $firstimg = array(\'popup\' => $data[\'popup\'],\'thumb\' => $data[\'thumb\']); \r\n		 array_unshift($data[\'images\'], $firstimg); \r\n		 \r\n		 ]]></add> \r\n		 </operation> \r\n\r\n		 <operation> \r\n		 <search ><![CDATA[$data[\'products\'][] = array(]]></search> \r\n		 <add position=\"before\"><![CDATA[ \r\n		 if ((float)$result[\'special\']) $discount = \'-\'.round((($result[\'price\'] - $result[\'special\'])/$result[\'price\'])*100, 0).\'%\'; \r\n		 else $discount = false; \r\n		 ]]></add> \r\n		 </operation> \r\n		 <operation> \r\n		 <search><![CDATA[$data[\'products\'][] = array]]></search> \r\n		 <add position=\"after\" trim=\"true\" offset=\"2\"><![CDATA[ \r\n		 \'special_end_date\' => $this->model_extension_soconfig_general->getDateEnd($result[\'product_id\']), \r\n		 \'discount\' => $discount,]]></add> \r\n		 </operation> \r\n		  <operation> \r\n		 <search><![CDATA[$data[\'images\'] = array()]]></search> \r\n		 <add position=\"before\" trim=\"true\" ><![CDATA[ \r\n		  if ($product_info[\'image\']) {\r\n			$data[\'popup\'] = $this->model_tool_image->resize($product_info[\'image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_popup_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_popup_height\'));\r\n		} else {\r\n			$data[\'popup\'] = $this->model_tool_image->resize(\'placeholder.png\', $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_popup_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_popup_height\'));\r\n		}\r\n\r\n		if ($product_info[\'image\']) {\r\n			$data[\'thumb\'] = $this->model_tool_image->resize($product_info[\'image\'], $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_thumb_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_thumb_height\'));\r\n		} else {\r\n			$data[\'thumb\'] = $this->model_tool_image->resize(\'placeholder.png\', $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_thumb_width\'), $this->config->get(\'theme_\' . $this->config->get(\'config_theme\') . \'_image_thumb_height\'));\r\n		}]]>\r\n		</add> \r\n		 </operation>  \r\n	</file>\r\n\r\n<!-- =======system/engine/router===============--> \r\n <file path=\"system/engine/router.php\"> \r\n <operation> \r\n <search ><![CDATA[while ($action instanceof Action)]]></search> \r\n <add position=\"before\"><![CDATA[ \r\n require_once(dirname(DIR_APPLICATION).\'/admin/view/template/extension/soconfig/class/soconfig.php\'); \r\n $soconfig = new Soconfig($this->registry); \r\n $this->registry->set(\'soconfig\', $soconfig); \r\n ]]></add> \r\n </operation> \r\n </file> \r\n \r\n<!-- ======= Show admin/controller==========--> \r\n <file path=\"admin/controller/design/layout.php\"> \r\n <operation > \r\n <search ><![CDATA[public function index()]]></search> \r\n <add position=\"before\" offset=\"3\"><![CDATA[require_once (DIR_APPLICATION.\'view/template/extension/soconfig/class/so_field.php\');]]></add> \r\n </operation> \r\n <operation > \r\n <search ><![CDATA[// Modules layout]]></search> \r\n <add position=\"before\"><![CDATA[ \r\n /*===== Load CSS & JS ========== */ \r\n if(!defined(\'DIR_SOCONFIG\')) define(\'DIR_SOCONFIG\',\'view/template/extension/soconfig/\'); \r\n $this->document->addScript(DIR_SOCONFIG.\'asset/plugin/select2/js/select2.min.js\'); \r\n $this->document->addStyle(DIR_SOCONFIG.\'asset/plugin/select2/css/select2.min.css\'); \r\n $fields = new So_Fields($data); \r\n $data[\'fields\'] = $fields; \r\n ]]></add> \r\n </operation> \r\n <operation > \r\n <search ><![CDATA[design/layout_form]]></search> \r\n <add position=\"replace\"><![CDATA[extension/soconfig/layout_form]]></add> \r\n </operation> \r\n </file> \r\n\r\n</modification>                                                                                                                      ',1,'2017-06-22 17:09:33','2018-09-17 14:37:48'),(3,49,'So Social Login','So-Social-Login','Opencartworks','1.1.3','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>So Social Login</name>\r\n    <code>So-Social-Login</code>\r\n    <version>1.1.3</version>\r\n    <author>Opencartworks</author>\r\n    <link>http://www.opencartworks.com/</link>\r\n        \r\n    <file path=\"catalog/view/theme/*/template/account/login.twig\">\r\n        <operation error=\"log\">\r\n            <search ><![CDATA[<div class=\"well\">]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                <div class=\"well col-sm-12\">    \r\n            ]]></add>\r\n        </operation>\r\n        \r\n        <operation error=\"log\">\r\n            <search ><![CDATA[<input type=\"submit\" value=\"{{ button_login }}\" class=\"btn btn-primary\" />]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                <input type=\"submit\" value=\"{{ button_login }}\" class=\"btn btn-primary pull-left\" />  \r\n            ]]></add>\r\n        </operation>\r\n        \r\n        <operation error=\"log\">\r\n            <search ><![CDATA[</form>]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                {% if setting is defined and setting.so_sociallogin_enable %}\r\n                    <column id=\"column-login\" class=\"col-sm-8 pull-right\">\r\n                        <div class=\"row\">\r\n                            {% if warning is defined %}\r\n                                <div class=\"alert alert-warning\"><i class=\"fa fa-check-circle\"></i> {{ warning }}</div>\r\n                            {% endif %}\r\n                          \r\n                            <div class=\"social_login pull-right\" id=\"so_sociallogin\">\r\n                                {% if setting.so_sociallogin_fbstatus %}\r\n                                    {% if setting.so_sociallogin_button == \'image\' %}\r\n                                        <a class=\"social-icon\"  href=\"{{ fblink }}\">\r\n                                            <img class=\"img-responsive\" src=\"{{ fbimage }}\" \r\n                                                data-toggle=\"tooltip\" alt=\"{{ setting.so_sociallogin_fbtitle }}\" \r\n                                                title=\"{{ setting.so_sociallogin_fbtitle }}\"\r\n                                            />\r\n                                        </a>\r\n                                    {% else %}\r\n                                        <a href=\"{{ fblink }}\" class=\"btn btn-social-icon btn-sm btn-facebook\"><i class=\"fa fa-facebook fa-fw\" aria-hidden=\"true\"></i></a>\r\n                                    {% endif %}\r\n                                {% endif %}\r\n                                \r\n                                {% if setting.so_sociallogin_twitstatus %}\r\n                                    {% if setting.so_sociallogin_button == \'image\' %}\r\n                                        <a class=\"social-icon\"  href=\"{{ twitlink }}\">\r\n                                            <img class=\"img-responsive\" src=\"{{ twitimage }}\" \r\n                                                data-toggle=\"tooltip\" alt=\"{{ setting.so_sociallogin_twittertitle }}\" \r\n                                                title=\"{{ setting.so_sociallogin_twittertitle }}\"\r\n                                            />\r\n                                        </a>\r\n                                    {% else %}\r\n                                        <a href=\"{{ twitlink }}\" class=\"btn btn-social-icon btn-sm btn-twitter\"><i class=\"fa fa-twitter fa-fw\" aria-hidden=\"true\"></i></a>\r\n                                    {% endif %}\r\n                                {% endif %}\r\n                                \r\n                                {% if setting.so_sociallogin_googlestatus %}\r\n                                    {% if setting.so_sociallogin_button == \'image\' %}\r\n                                        <a class=\"social-icon\" href=\"{{ googlelink }}\">\r\n                                            <img class=\"img-responsive\" src=\"{{ googleimage }}\" \r\n                                                data-toggle=\"tooltip\" alt=\"{{ setting.so_sociallogin_googletitle }}\" \r\n                                                title=\"{{ setting.so_sociallogin_googletitle }}\" \r\n                                            />\r\n                                        </a>\r\n                                    {% else %}\r\n                                        <a href=\"{{ googlelink }}\" class=\"btn btn-social-icon btn-sm btn-google-plus\"><i class=\"fa fa-google fa-fw\" aria-hidden=\"true\"></i></a>\r\n                                    {% endif %}\r\n                                {% endif %}\r\n                                \r\n                                {% if setting.so_sociallogin_linkstatus %}\r\n                                    {% if setting.so_sociallogin_button == \'image\' %}\r\n                                        <a class=\"social-icon\" href=\"{{ linkdinlink }}\">\r\n                                            <img class=\"img-responsive\" src=\"{{ linkdinimage }}\" \r\n                                                data-toggle=\"tooltip\" alt=\"{{ setting.so_sociallogin_linkedintitle }}\" \r\n                                                title=\"{{ setting.so_sociallogin_linkedintitle }}\"\r\n                                            />\r\n                                        </a>\r\n                                    {% else %}\r\n                                        <a href=\"{{ linkdinlink }}\" class=\"btn btn-social-icon btn-sm btn-linkdin\"><i class=\"fa fa-linkedin fa-fw\" aria-hidden=\"true\"></i></a>\r\n                                    {% endif %}\r\n                                {% endif %}\r\n                            </div>\r\n                        </div>\r\n                    </column>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        \r\n        <operation error=\"log\">\r\n            <search ><![CDATA[{{ footer }}]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                <style>\r\n                @media(max-width:991px){\r\n                    #column-login,.social_login,.socalicon{\r\n                        float:none !important;\r\n                        width:100%;\r\n                    }\r\n                    .account-login .btn-primary{\r\n                        float:none !important;\r\n                    }\r\n                    .social_login {\r\n                        padding:0 10px;\r\n                    }\r\n                }\r\n                </style>\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    \r\n    <file path=\"catalog/controller/account/login.php\">\r\n        <operation error=\"log\">\r\n            <search ><![CDATA[$data[\'header\'] = $this->load->controller(\'common/header\');]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                /* xml */\r\n                $this->load->model(\'setting/setting\');\r\n                $this->load->model(\'tool/image\');\r\n                $setting = $this->model_setting_setting->getSetting(\'so_sociallogin\');\r\n                if (isset($setting[\'so_sociallogin_enable\']) && $setting[\'so_sociallogin_enable\'] && $this->config->get(\'so_sociallogin_enable\')) {\r\n                    if(isset($this->session->data[\'route\']))\r\n                    {\r\n                        $location = $this->url->link($this->session->data[\'route\'], \"\", \'SSL\');\r\n                    }\r\n                    else\r\n                    {\r\n                        $location = $this->url->link(\"account/account\", \"\", \'SSL\');\r\n                    }\r\n                    \r\n                    /* Facebook Library */\r\n                    require_once (DIR_SYSTEM.\'library/so_social/Facebook/autoload.php\');\r\n                    \r\n                    /* Facebook  Login link code */\r\n                    $fb = new Facebook\\Facebook ([\r\n                        \'app_id\'                    => $setting[\'so_sociallogin_fbapikey\'], \r\n                        \'app_secret\'                => $setting[\'so_sociallogin_fbsecretapi\'],\r\n                        \'default_graph_version\'     => \'v2.4\',\r\n                    ]);\r\n\r\n                    $helper = $fb->getRedirectLoginHelper();\r\n\r\n                    /*\r\n                    try {\r\n                        $accessToken = $helper->getAccessToken();\r\n                    } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\r\n                        // When Graph returns an error\r\n                        echo \'Graph returned an error: \' . $e->getMessage();\r\n                        exit;\r\n                    } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\r\n                        // When validation fails or other local issues\r\n                        echo \'Facebook SDK returned an error: \' . $e->getMessage();\r\n                        exit;\r\n                    }\r\n                    */    \r\n                    \r\n                    $data[\'fblink\'] = $helper->getLoginUrl($this->url->link(\'extension/module/so_sociallogin/FacebookLogin\', \'\', \'SSL\'), array(\'public_profile\',\'email\'));\r\n                    /* Facebook  Login link code */\r\n            \r\n                    /* Google Libery file inculde */\r\n                    require_once DIR_SYSTEM.\'library/so_social/src/Google_Client.php\';\r\n                    require_once DIR_SYSTEM.\'library/so_social/src/contrib/Google_Oauth2Service.php\';\r\n                    \r\n                    /* Google Login link code */\r\n                    $gClient = new Google_Client();\r\n                    $gClient->setApplicationName($setting[\'so_sociallogin_googletitle\']);\r\n                    $gClient->setClientId($setting[\'so_sociallogin_googleapikey\']);\r\n                    $gClient->setClientSecret($setting[\'so_sociallogin_googlesecretapi\']);\r\n                    $gClient->setRedirectUri($this->url->link(\'extension/module/so_sociallogin/GoogleLogin\', \'\', \'SSL\'));\r\n                    $google_oauthV2 = new Google_Oauth2Service($gClient);\r\n                    $data[\'googlelink\']  = $gClient->createAuthUrl();\r\n                    \r\n                    /* Twitter Login */                     \r\n                    $data[\'twitlink\'] =  $this->url->link(\'extension/module/so_sociallogin/TwitterLogin\', \'\', \'SSL\');\r\n                    \r\n                    /* Linkedin Login */\r\n                    $data[\'linkdinlink\'] = $this->url->link(\'extension/module/so_sociallogin/LinkedinLogin\', \'\', \'SSL\');\r\n                    \r\n                    /* Get Image */\r\n                    $sociallogin_width = 130;\r\n                    $sociallogin_height = 35;\r\n                    if (isset($setting[\'so_sociallogin_width\']) && is_numeric($setting[\'so_sociallogin_width\'])) {\r\n                        $sociallogin_width = $setting[\'so_sociallogin_width\'];\r\n                    }\r\n                    if (isset($setting[\'so_sociallogin_height\']) && is_numeric($setting[\'so_sociallogin_height\'])) {\r\n                        $sociallogin_height = $setting[\'so_sociallogin_height\'];\r\n                    }\r\n                    if ($setting[\'so_sociallogin_fbimage\']) {\r\n                        $fbicon = $this->model_tool_image->resize($setting[\'so_sociallogin_fbimage\'], $sociallogin_width, $sociallogin_height);\r\n                    } else {\r\n                        $fbicon = $this->model_tool_image->resize(\'placeholder.png\', $sociallogin_width, $sociallogin_height);\r\n                    }\r\n                        \r\n                    if ($setting[\'so_sociallogin_twitimage\']) {\r\n                        $twiticon = $this->model_tool_image->resize($setting[\'so_sociallogin_twitimage\'], $sociallogin_width, $sociallogin_height);\r\n                    } else {\r\n                        $twiticon = $this->model_tool_image->resize(\'placeholder.png\', $sociallogin_width, $sociallogin_height);\r\n                    }\r\n                        \r\n                    if ($setting[\'so_sociallogin_googleimage\']) {\r\n                        $googleicon = $this->model_tool_image->resize($setting[\'so_sociallogin_googleimage\'], $sociallogin_width, $sociallogin_height);\r\n                    } else {\r\n                        $googleicon = $this->model_tool_image->resize(\'placeholder.png\', $sociallogin_width, $sociallogin_height);\r\n                    }\r\n                    \r\n                    if ($setting[\'so_sociallogin_linkdinimage\']) {\r\n                        $linkdinicon = $this->model_tool_image->resize($setting[\'so_sociallogin_linkdinimage\'], $sociallogin_width, $sociallogin_height);\r\n                    } else {\r\n                        $linkdinicon = $this->model_tool_image->resize(\'placeholder.png\', $sociallogin_width, $sociallogin_height);\r\n                    }\r\n                    \r\n                    $data[\'iconwidth\']  = $sociallogin_width;\r\n                    $data[\'iconheight\'] = $sociallogin_height;\r\n                    $data[\'status\']     = $setting[\'so_sociallogin_enable\'];\r\n                    $data[\'fbimage\']    = $fbicon;\r\n                    $data[\'twitimage\']  = $twiticon;\r\n                    $data[\'googleimage\'] = $googleicon;\r\n                    $data[\'linkdinimage\'] = $linkdinicon;\r\n                    \r\n                    $data[\'setting\'] = $setting;\r\n                }\r\n                /* xml */   \r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    \r\n    <file path=\"catalog/controller/common/header.php\">\r\n        <operation error=\"log\">\r\n            <search ><![CDATA[$data[\'title\'] = $this->document->getTitle();]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                $this->document->addStyle(\'catalog/view/javascript/so_sociallogin/css/so_sociallogin.css\');\r\n                $this->load->model(\'setting/setting\');\r\n                $this->load->model(\'tool/image\');\r\n                $setting = $this->model_setting_setting->getSetting(\'so_sociallogin\');\r\n                \r\n                if (isset($setting[\'so_sociallogin_enable\']) && $setting[\'so_sociallogin_enable\'] && $this->config->get(\'so_sociallogin_enable\')) {\r\n                    if(isset($this->session->data[\'route\']))\r\n                    {\r\n                        $location = $this->url->link($this->session->data[\'route\'], \"\", \'SSL\');\r\n                    }\r\n                    else\r\n                    {\r\n                        $location = $this->url->link(\"account/account\", \"\", \'SSL\');\r\n                    }\r\n                \r\n                    /* Facebook Library */\r\n                    require_once (DIR_SYSTEM.\'library/so_social/Facebook/autoload.php\');\r\n                    \r\n                    $fb = new Facebook\\Facebook ([\r\n                        \'app_id\'                    => $setting[\'so_sociallogin_fbapikey\'], \r\n                        \'app_secret\'                => $setting[\'so_sociallogin_fbsecretapi\'],\r\n                        \'default_graph_version\'     => \'v2.4\',\r\n                    ]);\r\n\r\n                    $helper = $fb->getRedirectLoginHelper();\r\n\r\n                    /*\r\n                    try {\r\n                        $accessToken = $helper->getAccessToken();\r\n                    } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\r\n                        // When Graph returns an error\r\n                        //echo \'Graph returned an error: \' . $e->getMessage();\r\n                        //exit;\r\n                    } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\r\n                        // When validation fails or other local issues\r\n                        //echo \'Facebook SDK returned an error: \' . $e->getMessage();\r\n                        //exit;\r\n                    }\r\n                    */    \r\n                    \r\n                    $data[\'fblink\'] = $helper->getLoginUrl($this->url->link(\'extension/module/so_sociallogin/FacebookLogin\', \'\', \'SSL\'), array(\'public_profile\',\'email\'));\r\n                    /* Facebook  Login link code */\r\n            \r\n                    /* Google Libery file inculde */\r\n                    require_once DIR_SYSTEM.\'library/so_social/src/Google_Client.php\';\r\n                    require_once DIR_SYSTEM.\'library/so_social/src/contrib/Google_Oauth2Service.php\';\r\n                    \r\n                    /* Google Login link code */\r\n                    $gClient = new Google_Client();\r\n                    $gClient->setApplicationName($setting[\'so_sociallogin_googletitle\']);\r\n                    $gClient->setClientId($setting[\'so_sociallogin_googleapikey\']);\r\n                    $gClient->setClientSecret($setting[\'so_sociallogin_googlesecretapi\']);\r\n                    $gClient->setRedirectUri($this->url->link(\'extension/module/so_sociallogin/GoogleLogin\', \'\', \'SSL\'));\r\n                    $google_oauthV2 = new Google_Oauth2Service($gClient);\r\n                    $data[\'googlelink\']  = $gClient->createAuthUrl();\r\n                    \r\n                    /* Twitter Login */                     \r\n                    $data[\'twitlink\'] =  $this->url->link(\'extension/module/so_sociallogin/TwitterLogin\', \'\', \'SSL\');\r\n                    \r\n                    /* Linkedin Login */\r\n                    $data[\'linkdinlink\'] = $this->url->link(\'extension/module/so_sociallogin/LinkedinLogin\', \'\', \'SSL\');\r\n                    \r\n                    /* Get Image */\r\n                    $sociallogin_width = 130;\r\n                    $sociallogin_height = 35;\r\n                    if (isset($setting[\'so_sociallogin_width\']) && is_numeric($setting[\'so_sociallogin_width\'])) {\r\n                        $sociallogin_width = $setting[\'so_sociallogin_width\'];\r\n                    }\r\n                    if (isset($setting[\'so_sociallogin_height\']) && is_numeric($setting[\'so_sociallogin_height\'])) {\r\n                        $sociallogin_height = $setting[\'so_sociallogin_height\'];\r\n                    }\r\n                    if ($setting[\'so_sociallogin_fbimage\']) {\r\n                        $fbicon = $this->model_tool_image->resize($setting[\'so_sociallogin_fbimage\'], $sociallogin_width, $sociallogin_height);\r\n                    } else {\r\n                        $fbicon = $this->model_tool_image->resize(\'placeholder.png\', $sociallogin_width, $sociallogin_height);\r\n                    }\r\n                        \r\n                    if ($setting[\'so_sociallogin_twitimage\']) {\r\n                        $twiticon = $this->model_tool_image->resize($setting[\'so_sociallogin_twitimage\'], $sociallogin_width, $sociallogin_height);\r\n                    } else {\r\n                        $twiticon = $this->model_tool_image->resize(\'placeholder.png\', $sociallogin_width, $sociallogin_height);\r\n                    }\r\n                        \r\n                    if ($setting[\'so_sociallogin_googleimage\']) {\r\n                        $googleicon = $this->model_tool_image->resize($setting[\'so_sociallogin_googleimage\'], $sociallogin_width, $sociallogin_height);\r\n                    } else {\r\n                        $googleicon = $this->model_tool_image->resize(\'placeholder.png\', $sociallogin_width, $sociallogin_height);\r\n                    }\r\n                    \r\n                    if ($setting[\'so_sociallogin_linkdinimage\']) {\r\n                        $linkdinicon = $this->model_tool_image->resize($setting[\'so_sociallogin_linkdinimage\'], $sociallogin_width, $sociallogin_height);\r\n                    } else {\r\n                        $linkdinicon = $this->model_tool_image->resize(\'placeholder.png\', $sociallogin_width, $sociallogin_height);\r\n                    }\r\n                    \r\n                    $data[\'iconwidth\']  = $sociallogin_width;\r\n                    $data[\'iconheight\'] = $sociallogin_height;\r\n                    $data[\'status\']     = $setting[\'so_sociallogin_enable\'];\r\n                    $data[\'fbimage\']    = $fbicon;\r\n                    $data[\'twitimage\']  = $twiticon;\r\n                    $data[\'googleimage\'] = $googleicon;\r\n                    $data[\'linkdinimage\'] = $linkdinicon;\r\n                    \r\n                    $data[\'setting\'] = $setting;\r\n    \r\n                    $this->load->language(\'extension/module/so_sociallogin\');\r\n                    $data[\'text_colregister\']   = $this->language->get(\'text_colregister\');\r\n                    $data[\'text_create_account\']   = $this->language->get(\'text_create_account\');\r\n                    $data[\'link_forgot_password\']   = $this->url->link(\'account/forgotten\', \'\', true);\r\n                    $data[\'text_forgot_password\']   = $this->language->get(\'text_forgot_password\');\r\n                    $data[\'text_title_popuplogin\']   = $this->language->get(\'text_title_popuplogin\');\r\n                    $data[\'text_title_login_with_social\']   = $this->language->get(\'text_title_login_with_social\');\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    \r\n    <file path=\"catalog/view/theme/*/template/common/header.twig\">\r\n        <operation error=\"log\">\r\n            <search><![CDATA[</header>]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                {% if setting is defined and setting.so_sociallogin_enable and setting.so_sociallogin_popuplogin %}\r\n                    <div class=\"modal fade in\" id=\"so_sociallogin\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"popupLoginLabel\" aria-hidden=\"true\">\r\n                        <div class=\"modal-dialog block-popup-login\">\r\n                            <a href=\"javascript:void(0)\" title=\"Close\" class=\"close close-login fa fa-times-circle\" data-dismiss=\"modal\"></a>\r\n                            <div class=\"tt_popup_login\"><strong>{{ text_title_popuplogin }}</strong></div>\r\n                            <div class=\"block-content\">\r\n                                <div class=\" col-reg registered-account\">\r\n                                    <div class=\"block-content\">\r\n                                        <form class=\"form form-login\" action=\"{{ login }}\" method=\"post\" id=\"login-form\">\r\n                                            <fieldset class=\"fieldset login\" data-hasrequired=\"* Required Fields\">\r\n                                                <div class=\"field email required email-input\">\r\n                                                    <div class=\"control\">\r\n                                                        <input name=\"email\" value=\"\" autocomplete=\"off\" id=\"email\" type=\"email\" class=\"input-text\" title=\"Email\" placeholder=\"E-mail Address\" />\r\n                                                    </div>\r\n                                                </div>\r\n                                                <div class=\"field password required pass-input\">\r\n                                                    <div class=\"control\">\r\n                                                        <input name=\"password\" type=\"password\" autocomplete=\"off\" class=\"input-text\" id=\"pass\" title=\"Password\" placeholder=\"Password\" />\r\n                                                    </div>\r\n                                                </div>\r\n                                                {% if setting.so_sociallogin_enable %}\r\n                                                <div class=\" form-group\">\r\n                                                    <label class=\"control-label\">{{ text_title_login_with_social }}</label>\r\n                                                    <div>\r\n                                                        {% if setting.so_sociallogin_googlestatus %}\r\n                                                            {% if setting.so_sociallogin_button == \'icon\' %}\r\n                                                                <a href=\"{{ googlelink }}\" class=\"btn btn-social-icon btn-sm btn-google-plus\"><i class=\"fa fa-google fa-fw\" aria-hidden=\"true\"></i></a>\r\n                                                            {% else %}\r\n                                                                <a class=\"social-icon\" href=\"{{ googlelink }}\">\r\n                                                                    <img class=\"img-responsive\" src=\"{{ googleimage }}\" \r\n                                                                        data-toggle=\"tooltip\" alt=\"{{ setting.so_sociallogin_googletitle }}\" \r\n                                                                        title=\"{{ setting.so_sociallogin_googletitle }}\" \r\n                                                                    />\r\n                                                                </a>\r\n                                                            {% endif %}\r\n                                                        {% endif %}\r\n                                                        {% if setting.so_sociallogin_fbstatus %}\r\n                                                            {% if setting.so_sociallogin_button == \'icon\' %}\r\n                                                                <a href=\"{{ fblink }}\" class=\"btn btn-social-icon btn-sm btn-facebook\"><i class=\"fa fa-facebook fa-fw\" aria-hidden=\"true\"></i></a>\r\n                                                            {% else %}\r\n                                                                <a href=\"{{ fblink }}\" class=\"social-icon\">\r\n                                                                    <img class=\"img-responsive\" src=\"{{ fbimage }}\" \r\n                                                                        data-toggle=\"tooltip\" alt=\"{{ setting.so_sociallogin_fbtitle }}\" \r\n                                                                        title=\"{{ setting.so_sociallogin_fbtitle }}\"\r\n                                                                    />\r\n                                                                </a>\r\n                                                            {% endif %}\r\n                                                        {% endif %}\r\n                                                        {% if setting.so_sociallogin_twitstatus %}\r\n                                                            {% if setting.so_sociallogin_button == \'icon\' %}\r\n                                                                <a href=\"{{ twitlink }}\" class=\"btn btn-social-icon btn-sm btn-twitter\"><i class=\"fa fa-twitter fa-fw\" aria-hidden=\"true\"></i></a>\r\n                                                            {% else %}\r\n                                                                <a class=\"social-icon\"  href=\"{{ twitlink }}\">\r\n                                                                    <img class=\"img-responsive\" src=\"{{ twitimage }}\" \r\n                                                                        data-toggle=\"tooltip\" alt=\"{{ setting.so_sociallogin_twittertitle }}\" \r\n                                                                        title=\"{{ setting.so_sociallogin_twittertitle }}\"\r\n                                                                    />\r\n                                                                </a>\r\n                                                            {% endif %}\r\n                                                        {% endif %}\r\n                                                        {% if setting.so_sociallogin_linkstatus %}\r\n                                                            {% if setting.so_sociallogin_button == \'icon\' %}\r\n                                                                <a href=\"{{ linkdinlink }}\" class=\"btn btn-social-icon btn-sm btn-linkdin\"><i class=\"fa fa-linkedin fa-fw\" aria-hidden=\"true\"></i></a>\r\n                                                            {% else %}\r\n                                                                <a class=\"social-icon\"  href=\"{{ linkdinlink }}\">\r\n                                                                    <img class=\"img-responsive\" src=\"{{ linkdinimage }}\" \r\n                                                                        data-toggle=\"tooltip\" alt=\"{{ setting.so_sociallogin_linkedintitle }}\" \r\n                                                                        title=\"{{ setting.so_sociallogin_linkedintitle }}\"\r\n                                                                    />\r\n                                                                </a>\r\n                                                            {% endif %}\r\n                                                        {% endif %}\r\n                                                    </div>\r\n                                                </div>\r\n                                                {% endif %}\r\n                                                <div class=\"secondary ft-link-p\"><a class=\"action remind\" href=\"{{ link_forgot_password }}\"><span>{{ text_forgot_password }}</span></a></div>\r\n                                                <div class=\"actions-toolbar\">\r\n                                                    <div class=\"primary\"><button type=\"submit\" class=\"action login primary\" name=\"send\" id=\"send2\"><span>{{ text_login }}</span></button></div>\r\n                                                </div>\r\n                                            </fieldset>\r\n                                        </form>\r\n                                    </div>\r\n                                </div>      \r\n                                <div class=\"col-reg login-customer\">\r\n                                    {{ text_colregister }}\r\n                                    <a class=\"btn-reg-popup\" title=\"{{ text_register }}\" href=\"{{ register }}\">{{ text_create_account }}</a>\r\n                                </div>\r\n                                <div style=\"clear:both;\"></div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <script type=\"text/javascript\">\r\n                        jQuery(document).ready(function($) {\r\n                            var $window = $(window);\r\n                            function checkWidth() {\r\n                                var windowsize = $window.width();\r\n                                if (windowsize > 767) {\r\n                                    $(\'a[href*=\"account/login\"]\').click(function (e) {\r\n                                        e.preventDefault();\r\n                                        $(\"#so_sociallogin\").modal(\'show\');\r\n                                    });\r\n                                }\r\n                            }\r\n                            checkWidth();\r\n                            $(window).resize(checkWidth);\r\n                        });\r\n                    </script>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n</modification>',1,'2018-09-05 20:48:30','0000-00-00 00:00:00'),(4,58,'So OnePage Checkout','so-onepage-checkout','OpenCartWorks','1.1.5','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>So OnePage Checkout</name>\r\n    <code>so-onepage-checkout</code>\r\n    <version>1.1.5</version>\r\n    <author>OpenCartWorks</author>\r\n    <link>http://www.opencartworks.com/</link>\r\n\r\n    <file path=\"catalog/controller/checkout/checkout.php\">\r\n        <operation error=\"log\">\r\n            <search ><![CDATA[class ControllerCheckoutCheckout extends Controller {]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                public function __construct($registry) {\r\n                    parent::__construct($registry);\r\n                    $this->load->language(\'checkout/cart\');\r\n                    $this->load->language(\'checkout/checkout\');\r\n            \r\n                    $this->load->language(\'checkout/coupon\');\r\n                    $this->load->language(\'checkout/voucher\');\r\n                    $this->load->language(\'extension/module/so_onepagecheckout\');\r\n            \r\n                    $this->load->model(\'account/activity\');\r\n                    $this->load->model(\'account/custom_field\');\r\n                    $this->load->model(\'tool/upload\');\r\n            \r\n                    $this->load->model(\'account/address\');\r\n                    $this->load->model(\'account/customer\');\r\n                    $this->load->model(\'account/customer_group\');\r\n                    $this->load->model(\'localisation/country\');\r\n                    $this->load->model(\'localisation/zone\');\r\n                    $this->load->model(\'extension/module/so_onepagecheckout\');\r\n                }\r\n                \r\n                public function getProperty($array, $property, $default_value = null) {\r\n                    $properties = explode(\'.\', $property);\r\n                    foreach ($properties as $prop) {\r\n                        if (!is_array($array) || !isset($array[$prop])) {\r\n                            return $default_value;\r\n                        }\r\n                        $array = $array[$prop];\r\n                    }\r\n                    if (is_array($array)) {\r\n                        return $array;\r\n                    }\r\n                    $array = trim($array);\r\n                    return $array !== \'\' ? $array : $default_value;\r\n                }\r\n                \r\n                private function isShippingRequired() {\r\n                    return $this->cart->hasShipping();\r\n                }\r\n            \r\n                private function isLoggedIn() {\r\n                    return $this->customer->isLogged();\r\n                }\r\n            \r\n                private function allowGuestCheckout() {\r\n                    return $this->config->get(\'config_checkout_guest\') && !$this->config->get(\'config_customer_price\') && !$this->cart->hasDownload();\r\n                }\r\n\r\n                private function renderRegisterForm() {\r\n                    $this->load->model(\'setting/setting\');\r\n                    $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n                    $data[\'setting_so_onepagecheckout\']                     = $setting_so_onepagecheckout;\r\n                    $data[\'setting_so_onepagecheckout_general\']             = $setting_so_onepagecheckout_general;\r\n                    $data[\'setting_so_onepagecheckout_layout_setting\']      = $setting_so_onepagecheckout_layout_setting;\r\n\r\n                    $data[\'text_register\'] = $this->language->get(\'text_register\');\r\n                    $data[\'text_guest\'] = $this->language->get(\'text_guest\');\r\n                    $data[\'entry_email\'] = $this->language->get(\'entry_email\');\r\n                    $data[\'entry_password\'] = $this->language->get(\'entry_password\');\r\n                    $data[\'text_forgotten\'] = $this->language->get(\'text_forgotten\');\r\n                    $data[\'text_loading\'] = $this->language->get(\'text_loading\');\r\n                    $data[\'button_login\'] = $this->language->get(\'button_login\');\r\n                    $data[\'text_i_am_returning_customer\'] = $this->language->get(\'text_i_am_returning_customer\');\r\n                    $data[\'text_returning_customer\'] = $this->language->get(\'text_returning_customer\');\r\n\r\n                    $data[\'text_your_details\'] = $this->language->get(\'text_your_details\');\r\n                    $data[\'entry_customer_group\'] = $this->language->get(\'entry_customer_group\');\r\n                    $data[\'entry_firstname\'] = $this->language->get(\'entry_firstname\');\r\n                    $data[\'entry_lastname\'] = $this->language->get(\'entry_lastname\');\r\n                    $data[\'entry_telephone\'] = $this->language->get(\'entry_telephone\');\r\n                    $data[\'entry_fax\'] = $this->language->get(\'entry_fax\');\r\n                    $data[\'text_your_password\'] = $this->language->get(\'text_your_password\');\r\n                    $data[\'entry_confirm\'] = $this->language->get(\'entry_confirm\');\r\n                    $data[\'text_your_address\'] = $this->language->get(\'text_your_address\');\r\n                    $data[\'entry_shipping\'] = $this->language->get(\'entry_shipping\');\r\n                    $data[\'text_shipping_address\'] = $this->language->get(\'text_shipping_address\');\r\n\r\n                    $data[\'customer_groups\'] = array();\r\n                    $data[\'customer_group_id\'] = $this->model_extension_module_so_onepagecheckout->getCustomerGroupId();\r\n                    if (is_array($this->config->get(\'config_customer_group_display\'))) {\r\n                        $this->load->model(\'account/customer_group\');\r\n\r\n                        $customer_groups = $this->model_account_customer_group->getCustomerGroups();\r\n\r\n                        foreach ($customer_groups  as $customer_group) {\r\n                            if (in_array($customer_group[\'customer_group_id\'], $this->config->get(\'config_customer_group_display\'))) {\r\n                                $data[\'customer_groups\'][] = $customer_group;\r\n                            }\r\n                        }\r\n                    }\r\n\r\n                    $data[\'payment_address_form\'] = $this->renderAddressForm(\'payment\', false);\r\n                    $data[\'shipping_address_form\'] = $this->renderAddressForm(\'shipping\');\r\n                    $data[\'shipping_address\'] = $this->getProperty($this->session->data, \'so_checkout_shipping_address\', \'1\');\r\n                    $data[\'is_shipping_required\'] = $this->isShippingRequired();\r\n\r\n                    $data[\'forgotten\'] = $this->url->link(\'account/forgotten\', \'\', true);\r\n\r\n                    $data[\'custom_fields\'] = $this->model_extension_module_so_onepagecheckout->getCustomFields();\r\n                    $data[\'order_data\'] = $this->model_extension_module_so_onepagecheckout->getOrder();\r\n\r\n                    return $this->load->view(\'extension/module/so_onepagecheckout/checkout/register\', $data);\r\n                }\r\n\r\n                private function renderAddressForm($type, $name = true) {\r\n                    $this->load->model(\'setting/setting\');\r\n                    $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n                    \r\n                    $data[\'type\'] = $type;\r\n                    $data[\'name\'] = $name;\r\n\r\n                    $data[\'button_upload\'] = $this->language->get(\'button_upload\');\r\n                    $data[\'text_address_existing\'] = $this->language->get(\'text_address_existing\');\r\n                    $data[\'text_address_new\'] = $this->language->get(\'text_address_new\');\r\n                    $data[\'text_select\'] = $this->language->get(\'text_select\');\r\n                    $data[\'text_none\'] = $this->language->get(\'text_none\');\r\n\r\n                    $data[\'entry_firstname\'] = $this->language->get(\'entry_firstname\');\r\n                    $data[\'entry_lastname\'] = $this->language->get(\'entry_lastname\');\r\n                    $data[\'entry_company\'] = $this->language->get(\'entry_company\');\r\n                    $data[\'entry_company_id\'] = $this->language->get(\'entry_company_id\');\r\n                    $data[\'entry_tax_id\'] = $this->language->get(\'entry_tax_id\');\r\n                    $data[\'entry_address_1\'] = $this->language->get(\'entry_address_1\');\r\n                    $data[\'entry_address_2\'] = $this->language->get(\'entry_address_2\');\r\n                    $data[\'entry_postcode\'] = $this->language->get(\'entry_postcode\');\r\n                    $data[\'entry_city\'] = $this->language->get(\'entry_city\');\r\n                    $data[\'entry_country\'] = $this->language->get(\'entry_country\');\r\n                    $data[\'entry_zone\'] = $this->language->get(\'entry_zone\');\r\n\r\n                    $data[\'custom_fields\'] = $this->model_extension_module_so_onepagecheckout->getCustomFields($type);\r\n                    $data[\'order_data\'] = $this->model_extension_module_so_onepagecheckout->getOrder();\r\n\r\n                    $data[\'addresses\'] = $this->model_account_address->getAddresses();\r\n                    $data[\'countries\'] = $this->model_localisation_country->getCountries();\r\n\r\n                    $address = $this->model_extension_module_so_onepagecheckout->getAddress($type);\r\n                    foreach ($address as $key => $value) {\r\n                        $data[$key] = $value;\r\n                    }\r\n\r\n                    if ($this->isLoggedIn()) {\r\n                        $data[\'is_logged_in\'] = true;\r\n                    } else {\r\n                        $data[\'is_logged_in\'] = false;\r\n                    }\r\n\r\n                    if (isset($setting_so_onepagecheckout_general[\'so_onepagecheckout_country_id\']) && $setting_so_onepagecheckout_general[\'so_onepagecheckout_country_id\']) {\r\n                        $data[\'country_id\'] = $setting_so_onepagecheckout_general[\'so_onepagecheckout_country_id\'];\r\n                    }\r\n\r\n                    if (isset($setting_so_onepagecheckout_general[\'so_onepagecheckout_zone_id\']) && $setting_so_onepagecheckout_general[\'so_onepagecheckout_zone_id\']) {\r\n                        $data[\'zone_id\'] = $setting_so_onepagecheckout_general[\'so_onepagecheckout_zone_id\'];\r\n                    }\r\n\r\n                    return $this->load->view(\'extension/module/so_onepagecheckout/checkout/address_form\', $data);\r\n                }\r\n\r\n                public function shipping($load = false) {\r\n                    $this->load->model(\'setting/setting\');\r\n                    $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n                    $data[\'setting_so_onepagecheckout\']                     = $setting_so_onepagecheckout;\r\n                    $data[\'setting_so_onepagecheckout_general\']             = $setting_so_onepagecheckout_general;\r\n                    $data[\'setting_so_onepagecheckout_layout_setting\']      = $setting_so_onepagecheckout_layout_setting;\r\n                    \r\n                    $data[\'text_shipping_method\'] = $this->language->get(\'text_shipping_method\');\r\n                    $data[\'text_title_shipping_method\'] = $this->language->get(\'text_title_shipping_method\');\r\n                    $data[\'error_shipping_method\'] = $this->language->get(\'error_shipping_method\');\r\n\r\n                    $data[\'shipping_methods\'] = $this->model_extension_module_so_onepagecheckout->getShippingMethods();\r\n                    $shipping_methods = array();\r\n                    if (count($data[\'shipping_methods\'])>0) {\r\n                        foreach ($data[\'shipping_methods\'] as $key=>$shipping_method) {\r\n                            if (@$setting_so_onepagecheckout_layout_setting[$key.\'_status\'] == 1) {\r\n                                $shipping_methods[] = $shipping_method;\r\n                            }\r\n                        }\r\n                    }\r\n                    $data[\'shipping_methods\'] = $shipping_methods;\r\n                    $data[\'code\'] = $this->model_extension_module_so_onepagecheckout->getShippingMethodCode();\r\n\r\n                    if (!$data[\'shipping_methods\']) {\r\n                        $data[\'error_warning\'] = sprintf($this->language->get(\'error_no_shipping\'), $this->url->link(\'information/contact\', \'\', true));\r\n                    } else {\r\n                        $data[\'error_warning\'] = \'\';\r\n                    }\r\n\r\n                    if ($load)\r\n                        return $this->load->view(\'extension/module/so_onepagecheckout/checkout/shipping_methods\', $data);\r\n                    else\r\n                        return $this->response->setOutput($this->load->view(\'extension/module/so_onepagecheckout/checkout/shipping_methods\', $data));\r\n\r\n                }\r\n\r\n                public function payment($load = false) {\r\n                    $this->load->model(\'setting/setting\');\r\n                    $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n                    $data[\'setting_so_onepagecheckout\']                     = $setting_so_onepagecheckout;\r\n                    $data[\'setting_so_onepagecheckout_general\']             = $setting_so_onepagecheckout_general;\r\n                    $data[\'setting_so_onepagecheckout_layout_setting\']      = $setting_so_onepagecheckout_layout_setting;\r\n\r\n                    $data[\'text_payment_method\']        = $this->language->get(\'text_payment_method\');\r\n                    $data[\'text_title_payment_method\']  = $this->language->get(\'text_title_payment_method\');\r\n\r\n                    $data[\'payment_methods\'] = $this->model_extension_module_so_onepagecheckout->getPaymentMethods();\r\n                    $payment_methods = array();\r\n                    if (count($data[\'payment_methods\'])>0) {\r\n                        foreach ($data[\'payment_methods\'] as $key=>$payment_method) {\r\n                            if (@$setting_so_onepagecheckout_layout_setting[$key.\'_status\'] == 1) {\r\n                                $payment_methods[] = $payment_method;\r\n                            }\r\n                        }\r\n                    }\r\n                    $data[\'payment_methods\'] = $payment_methods;\r\n                    $data[\'code\'] = $this->model_extension_module_so_onepagecheckout->getPaymentMethodCode();\r\n\r\n                    if (!$data[\'payment_methods\']) {\r\n                        $data[\'error_warning\'] = sprintf($this->language->get(\'error_no_payment\'), $this->url->link(\'information/contact\', \'\', true));\r\n                    } else {\r\n                        $data[\'error_warning\'] = \'\';\r\n                    }\r\n\r\n                    if ($load)\r\n                        return $this->load->view(\'extension/module/so_onepagecheckout/checkout/payment_methods\', $data);\r\n                    else\r\n                        return $this->response->setOutput($this->load->view(\'extension/module/so_onepagecheckout/checkout/payment_methods\', $data));\r\n                }\r\n\r\n                public function change_coupon_voucher_reward() {\r\n                    $this->load->model(\'setting/setting\');\r\n                    $this->load->language(\'checkout/cart\');\r\n                    $this->load->language(\'checkout/checkout\');\r\n                    $this->load->language(\'extension/module/so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n                    $data[\'setting_so_onepagecheckout\']                     = $setting_so_onepagecheckout;\r\n                    $data[\'setting_so_onepagecheckout_general\']             = $setting_so_onepagecheckout_general;\r\n                    $data[\'setting_so_onepagecheckout_layout_setting\']      = $setting_so_onepagecheckout_layout_setting;\r\n\r\n                    $data[\'text_loading\'] = $this->language->get(\'text_loading\');\r\n                    $data[\'text_coupon_voucher\'] = $this->language->get(\'text_coupon_voucher\');\r\n                    $data[\'text_enter_coupon_code\'] = $this->language->get(\'text_enter_coupon_code\');\r\n                    $data[\'text_enter_voucher_code\'] = $this->language->get(\'text_enter_voucher_code\');\r\n                    $data[\'text_apply_voucher\'] = $this->language->get(\'text_apply_voucher\');\r\n                    $data[\'text_enter_reward_points\'] = $this->language->get(\'text_enter_reward_points\');\r\n                    $data[\'text_apply_points\'] = $this->language->get(\'text_apply_points\');\r\n\r\n                    $_data = $this->request->post;\r\n\r\n                    if (@$_data[\'so_checkout_account\'] == \'login\') {\r\n                        $data[\'coupon_status\'] = $this->config->get(\'total_coupon_status\') && $setting_so_onepagecheckout_layout_setting[\'coupon_login_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'register\') {\r\n                        $data[\'coupon_status\'] = $this->config->get(\'total_coupon_status\') && $setting_so_onepagecheckout_layout_setting[\'coupon_register_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'guest\') {\r\n                        $data[\'coupon_status\'] = $this->config->get(\'total_coupon_status\') && $setting_so_onepagecheckout_layout_setting[\'coupon_guest_status\'];\r\n                    }else {\r\n                        $data[\'coupon_status\'] = $this->config->get(\'total_coupon_status\');\r\n                    }\r\n                    $data[\'entry_coupon\'] = $this->language->get(\'entry_coupon\');\r\n                    $data[\'button_coupon\'] = $this->language->get(\'button_coupon\');\r\n                    $data[\'coupon\'] = $this->getProperty($this->session->data, \'coupon\');\r\n\r\n                    if (@$_data[\'so_checkout_account\'] == \'login\') {\r\n                        $data[\'voucher_status\'] = $this->config->get(\'total_voucher_status\') && $setting_so_onepagecheckout_layout_setting[\'voucher_login_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'register\') {\r\n                        $data[\'voucher_status\'] = $this->config->get(\'total_voucher_status\') && $setting_so_onepagecheckout_layout_setting[\'voucher_register_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'guest\') {\r\n                        $data[\'voucher_status\'] = $this->config->get(\'total_voucher_status\') && $setting_so_onepagecheckout_layout_setting[\'voucher_guest_status\'];\r\n                    }else {\r\n                        $data[\'voucher_status\'] = $this->config->get(\'total_voucher_status\');\r\n                    }\r\n                    $data[\'entry_voucher\'] = $this->language->get(\'entry_voucher\');\r\n                    $data[\'button_voucher\'] = $this->language->get(\'button_voucher\');\r\n                    $data[\'voucher\'] = $this->getProperty($this->session->data, \'voucher\');\r\n\r\n                    $points = $this->customer->getRewardPoints();\r\n\r\n                    $points_total = 0;\r\n\r\n                    foreach ($this->cart->getProducts() as $product) {\r\n                        if ($product[\'points\']) {\r\n                            $points_total += $product[\'points\'];\r\n                        }\r\n                    }\r\n\r\n                    if (@$_data[\'so_checkout_account\'] == \'login\') {\r\n                        $data[\'reward_status\'] = $points && $points_total && $this->config->get(\'total_reward_status\') && $setting_so_onepagecheckout_layout_setting[\'reward_login_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'register\') {\r\n                        $data[\'reward_status\'] = $points && $points_total && $this->config->get(\'total_reward_status\') && $setting_so_onepagecheckout_layout_setting[\'reward_register_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'guest\') {\r\n                        $data[\'reward_status\'] = $points && $points_total && $this->config->get(\'total_reward_status\') && $setting_so_onepagecheckout_layout_setting[\'reward_guest_status\'];\r\n                    }\r\n                    else {\r\n                        $data[\'reward_status\'] = $points && $points_total && $this->config->get(\'total_reward_status\');\r\n                    }\r\n                    $data[\'entry_reward\'] = $this->language->get(\'entry_reward\');\r\n                    $data[\'button_reward\'] = $this->language->get(\'button_reward\');\r\n                    $data[\'reward\'] = $this->getProperty($this->session->data, \'reward\');\r\n\r\n                    echo $this->load->view(\'extension/module/so_onepagecheckout/checkout/coupon_voucher_reward\', $data);\r\n                    exit();\r\n                }\r\n\r\n                public function save() {\r\n                    $this->load->model(\'extension/module/so_onepagecheckout\');\r\n                    $this->load->model(\'account/address\');\r\n                    if ($value = $this->getProperty($this->request->post, \'shipping_address_id\')) {\r\n                        $this->session->data[\'shipping_address\'] = $this->model_account_address->getAddress($value);\r\n                        $this->model_extension_module_so_onepagecheckout->setAddress(\'shipping\', $this->session->data[\'shipping_address\']);\r\n                    }\r\n\r\n                    if ($value = $this->getProperty($this->request->post, \'shipping_country_id\')) {\r\n                        $this->model_extension_module_so_onepagecheckout->setAddress(\'shipping\', array(\r\n                            \'country_id\'    => $value,\r\n                            \'zone_id\'       => $this->getProperty($this->request->post, \'shipping_zone_id\'),\r\n                            \'postcode\'      => $this->getProperty($this->request->post, \'shipping_postcode\'),\r\n                        ));\r\n                    }\r\n\r\n                    if ($value = $this->getProperty($this->request->post, \'shipping_method\')) {\r\n                        $shipping = explode(\'.\', $value);\r\n                        $this->session->data[\'shipping_method\'] = $this->session->data[\'shipping_methods\'][$shipping[0]][\'quote\'][$shipping[1]];\r\n                    }\r\n\r\n                    if ($value = $this->getProperty($this->request->post, \'payment_address_id\')) {\r\n                        $this->session->data[\'payment_address\'] = $this->model_account_address->getAddress($value);\r\n                        $this->model_extension_module_so_onepagecheckout->setAddress(\'payment\', $this->session->data[\'payment_address\']);\r\n                    }\r\n\r\n                    if ($value = $this->getProperty($this->request->post, \'payment_country_id\')) {\r\n                        $this->model_extension_module_so_onepagecheckout->setAddress(\'payment\', array(\r\n                            \'country_id\'    => $value,\r\n                            \'zone_id\'       => $this->getProperty($this->request->post, \'payment_zone_id\'),\r\n                            \'postcode\'      => $this->getProperty($this->request->post, \'payment_postcode\'),\r\n                        ));\r\n                    }\r\n\r\n                    if ($value = $this->getProperty($this->request->post, \'payment_method\')) {\r\n                        $this->session->data[\'payment_method\'] = $this->session->data[\'payment_methods\'][$value];\r\n                    }\r\n\r\n                    $this->model_extension_module_so_onepagecheckout->save();\r\n\r\n                    header(\'Content-Type: application/json\');\r\n                    echo \'{}\';\r\n\r\n                    exit;\r\n                }\r\n\r\n                private function renderCouponVoucherReward() {\r\n                    $this->load->model(\'setting/setting\');\r\n                    $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n                    $data[\'setting_so_onepagecheckout\']                     = $setting_so_onepagecheckout;\r\n                    $data[\'setting_so_onepagecheckout_general\']             = $setting_so_onepagecheckout_general;\r\n                    $data[\'setting_so_onepagecheckout_layout_setting\']      = $setting_so_onepagecheckout_layout_setting;\r\n\r\n                    $data[\'text_loading\'] = $this->language->get(\'text_loading\');\r\n                    $data[\'text_coupon_voucher\'] = $this->language->get(\'text_coupon_voucher\');\r\n                    $data[\'text_enter_coupon_code\'] = $this->language->get(\'text_enter_coupon_code\');\r\n                    $data[\'text_enter_voucher_code\'] = $this->language->get(\'text_enter_voucher_code\');\r\n                    $data[\'text_apply_voucher\'] = $this->language->get(\'text_apply_voucher\');\r\n                    $data[\'text_enter_reward_points\'] = $this->language->get(\'text_enter_reward_points\');\r\n                    $data[\'text_apply_points\'] = $this->language->get(\'text_apply_points\');\r\n\r\n                    $_data = $this->session->data;\r\n\r\n                    if (@$_data[\'so_checkout_account\'] == \'login\') {\r\n                        $data[\'coupon_status\'] = $this->config->get(\'total_coupon_status\') && $setting_so_onepagecheckout_layout_setting[\'coupon_login_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'register\') {\r\n                        $data[\'coupon_status\'] = $this->config->get(\'total_coupon_status\') && $setting_so_onepagecheckout_layout_setting[\'coupon_register_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'guest\') {\r\n                        $data[\'coupon_status\'] = $this->config->get(\'total_coupon_status\') && $setting_so_onepagecheckout_layout_setting[\'coupon_guest_status\'];\r\n                    }else {\r\n                        $data[\'coupon_status\'] = $this->config->get(\'total_coupon_status\');\r\n                    }\r\n                    $data[\'entry_coupon\'] = $this->language->get(\'entry_coupon\');\r\n                    $data[\'button_coupon\'] = $this->language->get(\'button_coupon\');\r\n                    $data[\'coupon\'] = $this->getProperty($this->session->data, \'coupon\');\r\n\r\n                    if (@$_data[\'so_checkout_account\'] == \'login\') {\r\n                        $data[\'voucher_status\'] = $this->config->get(\'total_voucher_status\') && $setting_so_onepagecheckout_layout_setting[\'voucher_login_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'register\') {\r\n                        $data[\'voucher_status\'] = $this->config->get(\'total_voucher_status\') && $setting_so_onepagecheckout_layout_setting[\'voucher_register_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'guest\') {\r\n                        $data[\'voucher_status\'] = $this->config->get(\'total_voucher_status\') && $setting_so_onepagecheckout_layout_setting[\'voucher_guest_status\'];\r\n                    }else {\r\n                        $data[\'voucher_status\'] = $this->config->get(\'total_voucher_status\');\r\n                    }\r\n                    $data[\'entry_voucher\'] = $this->language->get(\'entry_voucher\');\r\n                    $data[\'button_voucher\'] = $this->language->get(\'button_voucher\');\r\n                    $data[\'voucher\'] = $this->getProperty($this->session->data, \'voucher\');\r\n\r\n                    $points = $this->customer->getRewardPoints();\r\n\r\n                    $points_total = 0;\r\n\r\n                    foreach ($this->cart->getProducts() as $product) {\r\n                        if ($product[\'points\']) {\r\n                            $points_total += $product[\'points\'];\r\n                        }\r\n                    }\r\n\r\n                    if (@$_data[\'so_checkout_account\'] == \'login\') {\r\n                        $data[\'reward_status\'] = $points && $points_total && $this->config->get(\'total_reward_status\') && $setting_so_onepagecheckout_layout_setting[\'reward_login_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'register\') {\r\n                        $data[\'reward_status\'] = $points && $points_total && $this->config->get(\'total_reward_status\') && $setting_so_onepagecheckout_layout_setting[\'reward_register_status\'];\r\n                    }else if (@$_data[\'so_checkout_account\'] == \'guest\') {\r\n                        $data[\'reward_status\'] = $points && $points_total && $this->config->get(\'total_reward_status\') && $setting_so_onepagecheckout_layout_setting[\'reward_guest_status\'];\r\n                    }\r\n                    else {\r\n                        $data[\'reward_status\'] = $points && $points_total && $this->config->get(\'total_reward_status\');\r\n                    }\r\n                    $data[\'entry_reward\'] = $this->language->get(\'entry_reward\');\r\n                    $data[\'button_reward\'] = $this->language->get(\'button_reward\');\r\n                    $data[\'reward\'] = $this->getProperty($this->session->data, \'reward\');\r\n\r\n                    return $this->load->view(\'extension/module/so_onepagecheckout/checkout/coupon_voucher_reward\', $data);\r\n                }\r\n\r\n                public function cart($load = false) {\r\n                    $this->load->model(\'setting/setting\');\r\n                    $this->load->model(\'extension/module/so_onepagecheckout\');\r\n                    $this->load->language(\'checkout/cart\');\r\n                    $this->load->language(\'checkout/checkout\');\r\n                    $this->load->language(\'extension/module/so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n                    \r\n                    $data[\'text_recurring_item\'] = $this->language->get(\'text_recurring_item\');\r\n                    $data[\'text_payment_recurring\'] = $this->language->get(\'text_payment_recurring\');\r\n                    $data[\'text_shopping_cart\'] = $this->language->get(\'text_shopping_cart\');\r\n                    $data[\'text_payment_detail\'] = $this->language->get(\'text_payment_detail\');\r\n\r\n                    $data[\'button_update\'] = $this->language->get(\'button_update\');\r\n                    $data[\'button_remove\'] = $this->language->get(\'button_remove\');\r\n\r\n                    $data[\'column_image\'] = $this->language->get(\'column_image\');\r\n                    $data[\'column_name\'] = $this->language->get(\'column_name\');\r\n                    $data[\'column_model\'] = $this->language->get(\'column_model\');\r\n                    $data[\'column_quantity\'] = $this->language->get(\'column_quantity\');\r\n                    $data[\'column_price\'] = $this->language->get(\'column_price\');\r\n                    $data[\'column_total\'] = $this->language->get(\'column_total\');\r\n\r\n                    $data[\'products\'] = $this->model_extension_module_so_onepagecheckout->getProducts();\r\n                    $data[\'vouchers\'] = $this->model_extension_module_so_onepagecheckout->getVouchers();\r\n                    $data[\'totals\']   = $this->model_extension_module_so_onepagecheckout->getTotals();\r\n\r\n                    if ($value = $this->getProperty($this->session->data, \'payment_method.code\')) {\r\n                        $data[\'payment\'] = $this->load->controller(\'extension/payment/\' . $value);\r\n                    } else {\r\n                        $data[\'payment\'] = \'\';\r\n                    }\r\n\r\n                    $data[\'session_data\']    = $this->session->data;\r\n\r\n                    if ($this->config->get(\'config_cart_weight\') && (isset($setting_so_onepagecheckout_layout_setting[\'show_product_weight\']) && $setting_so_onepagecheckout_layout_setting[\'show_product_weight\'])) {\r\n                        $data[\'weight\'] = $this->weight->format($this->cart->getWeight(), $this->config->get(\'config_weight_class_id\'), $this->language->get(\'decimal_point\'), $this->language->get(\'thousand_point\'));\r\n                    } else {\r\n                        $data[\'weight\'] = \'\';\r\n                    }\r\n\r\n                    $data[\'setting_so_onepagecheckout_layout_setting\']  = $setting_so_onepagecheckout_layout_setting;\r\n\r\n                    if ($load)\r\n                        return $this->load->view(\'extension/module/so_onepagecheckout/checkout/cart\', $data);\r\n                    else\r\n                        return $this->response->setOutput($this->load->view(\'extension/module/so_onepagecheckout/checkout/cart\', $data));\r\n                }\r\n\r\n                public function cart_update() {\r\n                    $this->load->language(\'checkout/cart\');\r\n                    $session_update = $this->getProperty($this->request->post, \'key\');\r\n                    $qty = $this->getProperty($this->request->post, \'quantity\');\r\n                    $this->cart->update($session_update, $qty);\r\n\r\n                    $json = array();\r\n\r\n                    if (!$this->checkCart()) {\r\n                        $json[\'redirect\'] = $this->url->link(\'checkout/cart\', \'\', true);\r\n                    } else {\r\n                        $json[\'total\'] = sprintf($this->language->get(\'text_items\'), $this->cart->countProducts() + (isset($this->session->data[\'vouchers\']) ? count($this->session->data[\'vouchers\']) : 0), $this->registry->get(\'currency\')->format($this->model_extension_module_so_onepagecheckout->getTotal(), $this->session->data[\'currency\']));\r\n                    }\r\n\r\n                    echo json_encode($json);\r\n                    exit;\r\n                }\r\n\r\n                public function cart_delete() {\r\n                    $session_delete = $this->getProperty($this->request->post, \'key\');\r\n\r\n                    $this->cart->remove($session_delete);\r\n\r\n                    unset($this->session->data[\'vouchers\'][$session_delete]);\r\n\r\n                    $json = array();\r\n\r\n                    if (!$this->checkCart()) {\r\n                        $json[\'redirect\'] = $this->url->link(\'checkout/cart\', \'\', true);\r\n                    } else {\r\n                        $json[\'total\'] = sprintf($this->language->get(\'text_items\'), $this->cart->countProducts() + (isset($this->session->data[\'vouchers\']) ? count($this->session->data[\'vouchers\']) : 0), $this->registry->get(\'currency\')->format($this->model_extension_module_so_onepagecheckout->getTotal(), $this->session->data[\'currency\']));\r\n                    }\r\n\r\n                    echo json_encode($json);\r\n                    exit;\r\n                }\r\n\r\n                private function checkCart() {\r\n                    // Validate cart has products and has stock.\r\n                    if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\r\n                        return false;\r\n                    }\r\n\r\n                    // Validate minimum quantity requirements.\r\n                    $products = $this->cart->getProducts();\r\n\r\n                    foreach ($products as $product) {\r\n                        $product_total = 0;\r\n\r\n                        foreach ($products as $product_2) {\r\n                            if ($product_2[\'product_id\'] == $product[\'product_id\']) {\r\n                                $product_total += $product_2[\'quantity\'];\r\n                            }\r\n                        }\r\n\r\n                        if ($product[\'minimum\'] > $product_total) {\r\n                            return false;\r\n                        }\r\n                    }\r\n\r\n                    return true;\r\n                }\r\n\r\n                public function confirm() {\r\n                    /* exit if page is accessed via get method */\r\n                    if ($this->request->server[\'REQUEST_METHOD\'] != \'POST\') {\r\n                        return;\r\n                    }\r\n                    $this->load->model(\'setting/setting\');\r\n                    $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n\r\n                    $order_data = $this->model_extension_module_so_onepagecheckout->getOrder();\r\n\r\n                    $new_payment_address = null;\r\n                    $new_shipping_address = null;\r\n\r\n                    $register_account = $this->getProperty($this->request->post, \'account\', \'register\');\r\n\r\n                    $errors = array();\r\n                    $redirect_cart = \'\';\r\n\r\n                    if (!$this->checkCart()) {\r\n                        $errors[\'cart\'] = \'\';\r\n                        $redirect_cart = $this->url->link(\'checkout/cart\', \'\', true);\r\n                    }\r\n\r\n                    if ($this->isLoggedIn()) {\r\n                        // payment data\r\n                        if ($this->getProperty($this->request->post, \'payment_address\') === \'existing\') {\r\n                            $address_info = $this->model_account_address->getAddress($this->getProperty($this->request->post, \'payment_address_id\'));\r\n                            $order_data = array_replace($order_data, $this->getAddressData($address_info, \'\', \'payment_\'));\r\n                        } else {\r\n                            $new_payment_address = $this->getAddressData($this->request->post, \'payment_\', \'payment_\');\r\n                            $order_data = array_replace($order_data, $new_payment_address);\r\n                            $errors = array_merge($errors, $this->validateAddressData($new_payment_address, \'payment_\'));\r\n                        }\r\n\r\n                        // shipping data\r\n                        if ($this->isShippingRequired()) {\r\n                            if ($this->getProperty($this->request->post, \'shipping_address\') === \'existing\') {\r\n                                $address_info = $this->model_account_address->getAddress($this->getProperty($this->request->post, \'shipping_address_id\'));\r\n                                $order_data = array_replace($order_data, $this->getAddressData($address_info, \'\', \'shipping_\'));\r\n                            } else {\r\n                                $new_shipping_address = $this->getAddressData($this->request->post, \'shipping_\', \'shipping_\');\r\n                                $order_data = array_replace($order_data, $new_shipping_address);\r\n                                $errors = array_merge($errors, $this->validateAddressData($new_shipping_address, \'shipping_\'));\r\n                            }\r\n                        }\r\n\r\n                        // customer data\r\n                        if (!$errors) {\r\n                            $customer_info = $this->model_account_customer->getCustomer($this->customer->getId());\r\n\r\n                            $order_data[\'customer_id\'] = $this->customer->getId();\r\n                            $order_data[\'customer_group_id\'] = $customer_info[\'customer_group_id\'];\r\n                            $order_data[\'firstname\'] = $customer_info[\'firstname\'];\r\n                            $order_data[\'lastname\'] = $customer_info[\'lastname\'];\r\n                            $order_data[\'email\'] = $customer_info[\'email\'];\r\n                            $order_data[\'telephone\'] = $customer_info[\'telephone\'];\r\n                            $order_data[\'fax\'] = $customer_info[\'fax\'];\r\n                            $order_data[\'custom_field\'] = version_compare(VERSION, \'2.1\', \'>=\') ? json_decode($customer_info[\'custom_field\'], true) : unserialize($customer_info[\'custom_field\']);\r\n                        }\r\n                    } else {\r\n                        // check firstname, lastname\r\n                        $errors = array_merge($errors, $this->validateUserData($this->request->post, $register_account));\r\n\r\n                        // check customer group id\r\n                        if (isset($this->request->post[\'customer_group_id\']) && is_array($this->config->get(\'config_customer_group_display\')) && in_array($this->request->post[\'customer_group_id\'], $this->config->get(\'config_customer_group_display\'))) {\r\n                            $order_data[\'customer_group_id\'] = $this->request->post[\'customer_group_id\'];\r\n                        } else {\r\n                            $order_data[\'customer_group_id\'] = $this->config->get(\'config_customer_group_id\');\r\n                        }\r\n\r\n                        if (!isset($this->request->post[\'account\'])) {\r\n                            $errors[\'account\'] = array_merge($errors, array(\'Does not account exists! Please check configuration\'));\r\n                        }\r\n\r\n                        // check passwords if register\r\n                        if (($register_account == \'register\') && isset($this->request->post[\'account\'])) {\r\n                            $errors = array_merge($errors, $this->validatePassword($this->request->post));\r\n                        }\r\n\r\n                        // check payment address\r\n                        $new_payment_address = $this->getAddressData($this->request->post, \'payment_\', \'payment_\');\r\n                        $order_data = array_replace($order_data, $new_payment_address);\r\n                        $errors = array_merge($errors, $this->validateAddressData($new_payment_address, \'payment_\', false));\r\n\r\n                        // add payment firstname and lastname\r\n                        $order_data[\'firstname\'] = $this->request->post[\'firstname\'];\r\n                        $order_data[\'lastname\'] = $this->request->post[\'lastname\'];\r\n                        $order_data[\'email\'] = $this->request->post[\'email\'];\r\n                        $order_data[\'telephone\'] = $this->request->post[\'telephone\'];\r\n                        $order_data[\'fax\'] = $this->request->post[\'fax\'];\r\n                        $order_data[\'custom_field\'] = $this->getProperty($this->request->post, \'custom_field\', array());\r\n                        $order_data[\'payment_firstname\'] = $order_data[\'firstname\'];\r\n                        $order_data[\'payment_lastname\'] = $order_data[\'lastname\'];\r\n\r\n                        // check delivery address\r\n                        if ($this->isShippingRequired()) {\r\n                            if (!$this->getProperty($this->request->post, \'shipping_address\')) {\r\n                                $new_shipping_address = $this->getAddressData($this->request->post, \'shipping_\', \'shipping_\');\r\n                                $order_data = array_replace($order_data, $new_shipping_address);\r\n                                $errors = array_merge($errors, $this->validateAddressData($new_shipping_address, \'shipping_\'));\r\n                            } else {\r\n                                $order_data = array_replace($order_data, $this->getAddressData($order_data, \'payment_\', \'shipping_\'));\r\n                            }\r\n                        }\r\n                    }\r\n\r\n                    // payment method\r\n                    if ($payment_method = $this->getProperty($this->session->data, \'payment_methods.\' . $this->getProperty($this->request->post, \'payment_method\') . \'.title\')) {\r\n                        $order_data[\'payment_method\'] = $payment_method;\r\n                        $order_data[\'payment_code\'] = $this->getProperty($this->request->post, \'payment_method\');\r\n                    } else {\r\n                        $errors[\'payment_method\'] = str_replace(\'&nbsp;\', \'\', strip_tags($this->language->get(\'error_no_payment\')));\r\n                    }\r\n\r\n                    // shipping method\r\n                    if ($this->isShippingRequired()) {\r\n                        $shipping = explode(\'.\', $this->getProperty($this->request->post, \'shipping_method\'));\r\n                        if (is_array($shipping) && count($shipping) > 1) {\r\n                            $shipping_method = $this->session->data[\'shipping_methods\'][$shipping[0]][\'quote\'][$shipping[1]];\r\n                            if ($shipping_method) {\r\n                                $order_data[\'shipping_method\'] = $shipping_method[\'title\'];\r\n                                $order_data[\'shipping_code\'] = $this->getProperty($this->request->post, \'shipping_method\');\r\n                            } else {\r\n                                $order_data[\'shipping_method\'] = \'no shipping method\';\r\n                                $errors[\'shipping_method\'] = str_replace(\'&nbsp;\', \'\', strip_tags($this->language->get(\'error_no_shipping\')));\r\n                            }\r\n                        } else {\r\n                            $order_data[\'shipping_method\'] = \'no shipping method\';\r\n                            $errors[\'shipping_method\'] = str_replace(\'&nbsp;\', \'\', strip_tags($this->language->get(\'error_no_shipping\')));\r\n                        }\r\n                    }\r\n\r\n                    // order totals\r\n                    $totals = array();\r\n                    $taxes = $this->cart->getTaxes();\r\n                    $total = 0;\r\n\r\n                    // Because __call can not keep var references so we put them into an array.\r\n                    $total_data = array(\r\n                        \'totals\' => &$totals,\r\n                        \'taxes\'  => &$taxes,\r\n                        \'total\'  => &$total\r\n                    );\r\n\r\n                    $this->load->model(\'setting/extension\');\r\n                    $results = $this->model_setting_extension->getExtensions(\'total\');\r\n                    \r\n                    $sort_order = array();\r\n\r\n                    foreach ($results as $key => $value) {\r\n                        $sort_order[$key] = $this->config->get(\'total_\'.$value[\'code\'] . \'_sort_order\');\r\n                    }\r\n\r\n                    array_multisort($sort_order, SORT_ASC, $results);\r\n\r\n                    foreach ($results as $result) {\r\n                        if ($this->config->get(\'total_\'.$result[\'code\'] . \'_status\')) {\r\n                            $this->load->model(\'extension/total/\' . $result[\'code\']);\r\n                            \r\n                            $this->{\'model_extension_total_\' . $result[\'code\']}->getTotal($total_data);\r\n                        }\r\n                    }\r\n\r\n                    $sort_order = array();\r\n\r\n                    foreach ($totals as $key => $value) {\r\n                        $sort_order[$key] = $value[\'sort_order\'];\r\n                    }\r\n\r\n                    array_multisort($sort_order, SORT_ASC, $totals);\r\n\r\n                    $order_data[\'totals\'] = $totals;\r\n                    $order_data[\'total\'] = $total;\r\n\r\n                    // order products\r\n                    $order_data[\'products\'] = array();\r\n\r\n                    foreach ($this->cart->getProducts() as $product) {\r\n                        $option_data = array();\r\n\r\n                        foreach ($product[\'option\'] as $option) {\r\n                            $option_data[] = array(\r\n                                \'product_option_id\'       => $option[\'product_option_id\'],\r\n                                \'product_option_value_id\' => $option[\'product_option_value_id\'],\r\n                                \'option_id\'               => $option[\'option_id\'],\r\n                                \'option_value_id\'         => $option[\'option_value_id\'],\r\n                                \'name\'                    => $option[\'name\'],\r\n                                \'value\'                   => $option[\'value\'],\r\n                                \'type\'                    => $option[\'type\']\r\n                            );\r\n                        }\r\n\r\n                        $order_data[\'products\'][] = array(\r\n                            \'product_id\' => $product[\'product_id\'],\r\n                            \'name\'       => $product[\'name\'],\r\n                            \'model\'      => $product[\'model\'],\r\n                            \'option\'     => $option_data,\r\n                            \'download\'   => $product[\'download\'],\r\n                            \'quantity\'   => $product[\'quantity\'],\r\n                            \'subtract\'   => $product[\'subtract\'],\r\n                            \'price\'      => $product[\'price\'],\r\n                            \'total\'      => $product[\'total\'],\r\n                            \'tax\'        => $this->tax->getTax($product[\'price\'], $product[\'tax_class_id\']),\r\n                            \'reward\'     => $product[\'reward\']\r\n                        );\r\n                    }\r\n\r\n                    // Gift Voucher\r\n                    $order_data[\'vouchers\'] = array();\r\n\r\n                    if (!empty($this->session->data[\'vouchers\'])) {\r\n                        foreach ($this->session->data[\'vouchers\'] as $voucher) {\r\n                            $order_data[\'vouchers\'][] = array(\r\n                                \'description\'      => $voucher[\'description\'],\r\n                                \'code\'             => substr(md5(mt_rand()), 0, 10),\r\n                                \'to_name\'          => $voucher[\'to_name\'],\r\n                                \'to_email\'         => $voucher[\'to_email\'],\r\n                                \'from_name\'        => $voucher[\'from_name\'],\r\n                                \'from_email\'       => $voucher[\'from_email\'],\r\n                                \'voucher_theme_id\' => $voucher[\'voucher_theme_id\'],\r\n                                \'message\'          => $voucher[\'message\'],\r\n                                \'amount\'           => $voucher[\'amount\']\r\n                            );\r\n                        }\r\n                    }\r\n\r\n                    // comment + checkboxes\r\n                    $order_data[\'comment\'] = $this->getProperty($this->request->post, \'comment\');\r\n                    if ($setting_so_onepagecheckout_layout_setting[\'require_comment_status\'] == 1 && empty($order_data[\'comment\'])) {\r\n                        $errors[\'comment\']  = $this->language->get(\'error_comment\');\r\n                    }\r\n\r\n                    if (!$this->isLoggedIn() && $this->config->get(\'config_account_id\')) {\r\n                        $this->load->model(\'catalog/information\');\r\n\r\n                        $information_info = $this->model_catalog_information->getInformation($this->config->get(\'config_account_id\'));\r\n\r\n                        if ($information_info && !isset($this->request->post[\'privacy\'])) {\r\n                            $errors[\'privacy\'] = sprintf($this->language->get(\'error_agree\'), $information_info[\'title\']);\r\n                        }\r\n                    }\r\n\r\n                    if ($this->config->get(\'config_checkout_id\')) {\r\n                        $this->load->model(\'catalog/information\');\r\n\r\n                        $information_info = $this->model_catalog_information->getInformation($this->config->get(\'config_checkout_id\'));\r\n\r\n                        if ($information_info && !isset($this->request->post[\'agree\'])) {\r\n                            $errors[\'agree\'] = sprintf($this->language->get(\'error_agree\'), $information_info[\'title\']);\r\n                        }\r\n                    }\r\n\r\n                    if (isset($errors[\'agree\']) && empty($setting_so_onepagecheckout_layout_setting[\'show_term\'])) {\r\n                        unset($errors[\'agree\']);\r\n                    }\r\n\r\n                    if ($this->config->get(\'config_account_id\') == $this->config->get(\'config_checkout_id\')) {\r\n                        unset($errors[\'privacy\']);\r\n                    }\r\n\r\n                    $redirect = \'\';\r\n\r\n                    // update order\r\n                    $this->model_extension_module_so_onepagecheckout->setOrderData($order_data);\r\n\r\n                    if ($this->getProperty($this->request->get, \'saveOnly\') === \'true\') {\r\n                        header(\'Content-Type: application/json\');\r\n                        echo json_encode(array(\r\n                            \'order_data\'=> $order_data\r\n                        ));\r\n                        exit;\r\n                    }\r\n\r\n                    if (!$errors) {\r\n                        if ($this->isLoggedIn()) {\r\n                            // save new payment address\r\n                            if ($new_payment_address) {\r\n                                $this->model_account_address->addAddress($this->customer->getId(), $this->getAddressData($new_payment_address, \'payment_\'));\r\n                            }\r\n\r\n                            // save new shipping address\r\n                            if ($new_shipping_address && $new_shipping_address !== $new_payment_address) {\r\n                                $this->model_account_address->addAddress($this->customer->getId(), $this->getAddressData($new_shipping_address, \'shipping_\'));\r\n                            }\r\n\r\n                            $this->model_extension_module_so_onepagecheckout->updateCustomer();\r\n                        } else if ($register_account == \'register\') {\r\n                            $redirect = $this->registerAccount();\r\n                            $sql = \"UPDATE `\" . DB_PREFIX . \"order` SET customer_id = \'\" . (int)($this->customer->getId()) . \"\', customer_group_id = \'\" . (int)($this->customer->getGroupId()) . \"\' WHERE order_id = \'\" . (int)($this->session->data[\'order_id\']) . \"\'\";\r\n                            $this->db->query($sql);\r\n                        } else {\r\n                            $this->session->data[\'guest\'] = $this->getAddressData($order_data, \'payment_\');\r\n                        }\r\n                    }\r\n\r\n                    $this->session->data[\'so_checkout_account\']             = $this->getProperty($this->request->post, \'account\');\r\n                    $this->session->data[\'so_checkout_shipping_address\']    = $this->getProperty($this->request->post, \'shipping_address\', \'0\');\r\n\r\n                    // send response\r\n                    header(\'Content-Type: application/json\');\r\n                    echo json_encode(array(\r\n                        \'errors\'    => $errors ? $errors : null,\r\n                        \'account_status\' => $this->isLoggedIn() ? 1 : 0,\r\n                        \'redirect\'  => $redirect,\r\n                        \'redirect_cart\' => $redirect_cart,\r\n                        \'order_data\'=> $order_data\r\n                    ));\r\n                    exit;\r\n                }\r\n\r\n                private function validateAddressData($data, $key, $name = true) {\r\n                    $errors = array();\r\n\r\n                    if ($name) {\r\n                        // firstname\r\n                        if ((utf8_strlen(trim($data[$key . \'firstname\'])) < 1) || (utf8_strlen(trim($data[$key . \'firstname\'])) > 32)) {\r\n                            $errors[$key . \'firstname\'] = $this->language->get(\'error_firstname\');\r\n                        }\r\n\r\n                        // lastname\r\n                        if ((utf8_strlen(trim($data[$key . \'lastname\'])) < 1) || (utf8_strlen(trim($data[$key . \'lastname\'])) > 32)) {\r\n                            $errors[$key . \'lastname\'] = $this->language->get(\'error_lastname\');\r\n                        }\r\n                    }\r\n\r\n                    if ((utf8_strlen(trim($data[$key . \'address_1\'])) < 3) || (utf8_strlen(trim($data[$key . \'address_1\'])) > 128)) {\r\n                        $errors[$key . \'address_1\'] = $this->language->get(\'error_address_1\');\r\n                    }\r\n\r\n                    if ((utf8_strlen($data[$key . \'city\']) < 2) || (utf8_strlen($data[$key . \'city\']) > 32)) {\r\n                        $errors[$key . \'city\'] = $this->language->get(\'error_city\');\r\n                    }\r\n\r\n                    $country_info = $this->model_localisation_country->getCountry($data[$key . \'country_id\']);\r\n\r\n                    if ($country_info && $country_info[\'postcode_required\'] && (utf8_strlen(trim($data[$key . \'postcode\'])) < 2 || utf8_strlen(trim($data[$key . \'postcode\'])) > 10)) {\r\n                        $errors[$key . \'postcode\'] = $this->language->get(\'error_postcode\');\r\n                    }\r\n\r\n                    if ($data[$key . \'country_id\'] == \'\') {\r\n                        $errors[$key . \'country\'] = $this->language->get(\'error_country\');\r\n                    }\r\n\r\n                    if (!isset($data[$key . \'zone_id\']) || $data[$key . \'zone_id\'] == \'\' || !is_numeric($data[$key . \'zone_id\'])) {\r\n                        $errors[$key . \'zone\'] = $this->language->get(\'error_zone\');\r\n                    }\r\n\r\n                    // Custom field validation\r\n                    $custom_fields = $this->model_extension_module_so_onepagecheckout->getCustomFields();\r\n                    foreach ($custom_fields as $custom_field) {\r\n                        if (($custom_field[\'location\'] == \'address\') && $custom_field[\'required\'] && empty($data[$key . \'custom_field\'][$custom_field[\'custom_field_id\']])) {\r\n                            $errors[$key . \'custom_field\' . $custom_field[\'custom_field_id\']] = sprintf($this->language->get(\'error_custom_field\'), $custom_field[\'name\']);\r\n                        }\r\n                    }\r\n                    \r\n                    return $errors;\r\n                }\r\n\r\n                private function validateUserData($data, $register) {\r\n                    $errors = array();\r\n\r\n                    // firstname\r\n                    if ((utf8_strlen(trim($data[\'firstname\'])) < 1) || (utf8_strlen(trim($data[\'firstname\'])) > 32)) {\r\n                        $errors[\'firstname\'] = $this->language->get(\'error_firstname\');\r\n                    }\r\n\r\n                    // lastname\r\n                    if ((utf8_strlen(trim($data[\'lastname\'])) < 1) || (utf8_strlen(trim($data[\'lastname\'])) > 32)) {\r\n                        $errors[\'lastname\'] = $this->language->get(\'error_lastname\');\r\n                    }\r\n\r\n                    // email\r\n                    if ((utf8_strlen($data[\'email\']) > 96) || !preg_match(\'/^[^\\@]+@.*.[a-z]{2,15}$/i\', $data[\'email\'])) {\r\n                        $errors[\'email\'] = $this->language->get(\'error_email\');\r\n                    } else if ($register && $this->model_account_customer->getTotalCustomersByEmail($data[\'email\'])) {\r\n                        $errors[\'email\'] = $this->language->get(\'error_exists\');\r\n                    }\r\n\r\n                    // telephone\r\n                    if ((utf8_strlen($data[\'telephone\']) < 3) || (utf8_strlen($data[\'telephone\']) > 32)) {\r\n                        $errors[\'telephone\'] = $this->language->get(\'error_telephone\');\r\n                    }\r\n\r\n                    // Custom field validation\r\n                    $custom_fields = $this->model_extension_module_so_onepagecheckout->getCustomFields();\r\n\r\n                    foreach ($custom_fields as $custom_field) {\r\n                        if (($custom_field[\'location\'] == \'account\') && $custom_field[\'required\'] && empty($data[\'custom_field\'][$custom_field[\'custom_field_id\']])) {\r\n                            $errors[\'custom_field\' . $custom_field[\'custom_field_id\']] = sprintf($this->language->get(\'error_custom_field\'), $custom_field[\'name\']);\r\n                        }\r\n                    }\r\n                    \r\n                    return $errors;\r\n                }\r\n\r\n                private function validatePassword($data) {\r\n                    $errors = array();\r\n\r\n                    if ((utf8_strlen($data[\'password\']) < 4) || (utf8_strlen($data[\'password\']) > 20)) {\r\n                        $errors[\'password\'] = $this->language->get(\'error_password\');\r\n                    }\r\n\r\n                    if ($data[\'confirm\'] != $data[\'password\']) {\r\n                        $errors[\'confirm\'] = $this->language->get(\'error_confirm\');\r\n                    }\r\n\r\n                    return $errors;\r\n                }\r\n\r\n                private function getAddressData($array, $i_address = \'\', $prefix = \'\') {\r\n                    $keys = array(\r\n                        \'address_1\',\r\n                        \'address_2\',\r\n                        \'address_id\',\r\n                        \'address_format\',\r\n                        \'city\',\r\n                        \'company\',\r\n                        \'company_id\',\r\n                        \'country\',\r\n                        \'country_id\',\r\n                        \'firstname\',\r\n                        \'lastname\',\r\n                        \'method\',\r\n                        \'postcode\',\r\n                        \'tax_id\',\r\n                        \'zone\',\r\n                        \'zone_id\'\r\n                    );\r\n\r\n                    $result = array();\r\n\r\n                    foreach ($keys as $k) {\r\n                        $result[$prefix . $k] = $this->getProperty($array, $i_address . $k, \'\');\r\n                    }\r\n\r\n                    if ($result[$prefix . \'country_id\']) {\r\n                        $country_info = $this->model_localisation_country->getCountry($result[$prefix . \'country_id\']);\r\n                        if ($country_info) {\r\n                            if (!$result[$prefix . \'country\']) {\r\n                                $result[$prefix . \'country\'] = $country_info[\'name\'];\r\n                            }\r\n                            $result[$prefix . \'address_format\'] = $country_info[\'address_format\'];\r\n                        }\r\n                    }\r\n\r\n                    if (!$result[$prefix . \'zone\'] && $result[$prefix . \'zone_id\']) {\r\n                        $zone_info = $this->model_localisation_zone->getZone($result[$prefix . \'zone_id\']);\r\n                        if ($zone_info) {\r\n                            $result[$prefix . \'zone\'] = $zone_info[\'name\'];\r\n                        }\r\n                    }\r\n\r\n                    $result[$prefix . \'custom_field\'] = $this->getProperty($array, $i_address . \'custom_field\', array());\r\n                    \r\n                    return $result;\r\n                }\r\n\r\n                private function registerAccount() {\r\n                    $redirect = \'\';\r\n\r\n                    $data = $this->getAddressData($this->request->post, \'payment_\');\r\n\r\n                    $data = array_merge($data, array(\r\n                        \'firstname\'     => $this->getProperty($this->request->post, \'firstname\'),\r\n                        \'lastname\'      => $this->getProperty($this->request->post, \'lastname\'),\r\n                        \'customer_group_id\'=> $this->getProperty($this->request->post, \'customer_group_id\', $this->config->get(\'config_customer_group_id\')),\r\n                        \'custom_field\'  => array(\r\n                            \'account\'   => $this->getProperty($this->request->post, \'custom_field\'),\r\n                            \'address\'   => $this->getProperty($this->request->post, \'payment_custom_field\'),\r\n                        ),\r\n                        \'email\'         => $this->getProperty($this->request->post, \'email\'),\r\n                        \'telephone\'     => $this->getProperty($this->request->post, \'telephone\'),\r\n                        \'fax\'           => $this->getProperty($this->request->post, \'fax\'),\r\n                        \'password\'      => $this->getProperty($this->request->post, \'password\'),\r\n                        \'newsletter\'    => $this->getProperty($this->request->post, \'newsletter\')\r\n                    ));\r\n\r\n                    $customer_id = $this->model_account_customer->addCustomer($data);\r\n\r\n                    // Clear any previous login attempts for unregistered accounts.\r\n                    $this->model_account_customer->deleteLoginAttempts($data[\'email\']);\r\n                    \r\n                    $this->session->data[\'account\'] = \'register\';\r\n\r\n                    $customer_group_info = $this->model_account_customer_group->getCustomerGroup($this->getProperty($this->request->post, \'customer_group_id\', $this->config->get(\'config_customer_group_id\')));\r\n\r\n                    if ($customer_group_info && !$customer_group_info[\'approval\']) {\r\n                        $this->customer->login($data[\'email\'], $data[\'password\']);\r\n\r\n                        if ($this->getProperty($this->request->post, \'shipping_address\') != \'1\') {\r\n                            $this->model_account_address->addAddress($customer_id, $this->getAddressData($this->request->post, \'shipping_\'));\r\n                        }\r\n\r\n                        // Add to activity log\r\n                        $activity_data = array(\r\n                            \'customer_id\' => $customer_id,\r\n                            \'name\' => $data[\'firstname\'] . \' \' . $data[\'lastname\']\r\n                        );\r\n\r\n                        $this->model_account_activity->addActivity(\'register\', $activity_data);\r\n                    }\r\n                    else {\r\n                        $redirect = $this->url->link(\'account/success\');\r\n                    }\r\n\r\n                    return $redirect;\r\n                }\r\n\r\n                public function login() {\r\n                    $json = array();\r\n\r\n                    if ($this->customer->isLogged()) {\r\n                        $json[\'redirect\'] = $this->url->link(\'checkout/checkout\', \'\', true);\r\n                    }\r\n\r\n                    if ((!$this->cart->hasProducts() && empty($this->session->data[\'vouchers\'])) || (!$this->cart->hasStock() && !$this->config->get(\'config_stock_checkout\'))) {\r\n                        $json[\'redirect\'] = $this->url->link(\'checkout/cart\', \'\', true);\r\n                    }\r\n\r\n                    if (!$json) {\r\n                        $this->load->model(\'account/customer\');\r\n\r\n                        // Check how many login attempts have been made.\r\n                        $login_info = $this->model_account_customer->getLoginAttempts($this->request->post[\'email\']);\r\n\r\n                        if ($login_info && ($login_info[\'total\'] >= $this->config->get(\'config_login_attempts\')) && strtotime(\'-1 hour\') < strtotime($login_info[\'date_modified\'])) {\r\n                            $json[\'error\'][\'warning\'] = $this->language->get(\'error_attempts\');\r\n                        }\r\n\r\n                        // Check if customer has been approved.\r\n                        $customer_info = $this->model_account_customer->getCustomerByEmail($this->request->post[\'email\']);\r\n\r\n                        if ($customer_info && !$customer_info[\'status\']) {\r\n                            $json[\'error\'][\'warning\'] = $this->language->get(\'error_approved\');\r\n                        }\r\n\r\n                        if (!isset($json[\'error\'])) {\r\n                            if (!$this->customer->login($this->request->post[\'email\'], $this->request->post[\'password\'])) {\r\n                                $json[\'error\'][\'warning\'] = $this->language->get(\'error_login\');\r\n\r\n                                $this->model_account_customer->addLoginAttempt($this->request->post[\'email\']);\r\n                            } else {\r\n                                $this->model_account_customer->deleteLoginAttempts($this->request->post[\'email\']);\r\n                            }\r\n                        }\r\n                    }\r\n\r\n                    if (!$json) {\r\n                        unset($this->session->data[\'guest\']);\r\n\r\n                        $this->load->model(\'account/address\');\r\n\r\n                        $address_info = $this->model_account_address->getAddress($this->customer->getAddressId());\r\n\r\n                        if ($this->config->get(\'config_tax_customer\') == \'payment\') {\r\n                            $this->session->data[\'payment_address\'] = $address_info;\r\n                        }\r\n\r\n                        if ($this->config->get(\'config_tax_customer\') == \'shipping\') {\r\n                            $this->session->data[\'shipping_address\'] = $address_info;\r\n                        }\r\n\r\n                        $this->model_extension_module_so_onepagecheckout->setAddress(\'shipping\', $address_info);\r\n                        $this->model_extension_module_so_onepagecheckout->setAddress(\'payment\', $address_info);\r\n                        $this->model_extension_module_so_onepagecheckout->save();\r\n\r\n                        $json[\'redirect\'] = $this->url->link(\'checkout/checkout\', \'\', true);\r\n\r\n                        // Add to activity log\r\n                        $this->load->model(\'account/activity\');\r\n\r\n                        $activity_data = array(\r\n                            \'customer_id\' => $this->customer->getId(),\r\n                            \'name\' => $this->customer->getFirstName() . \' \' . $this->customer->getLastName()\r\n                        );\r\n\r\n                        $this->model_account_activity->addActivity(\'login\', $activity_data);\r\n                    }\r\n                    \r\n                    $this->response->addHeader(\'Content-Type: application/json\');\r\n                    $this->response->setOutput(json_encode($json));\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        \r\n        <operation error=\"log\">\r\n            <search ><![CDATA[$data[\'breadcrumbs\'] = array();]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                $this->load->model(\'setting/setting\');\r\n                $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                if (isset($setting_so_onepagecheckout) && count($setting_so_onepagecheckout)>0) {\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];                \r\n                    if (isset($setting_so_onepagecheckout_general[\'so_onepagecheckout_enabled\']) && $setting_so_onepagecheckout_general[\'so_onepagecheckout_enabled\']) {\r\n                        $this->document->addStyle(\'catalog/view/javascript/so_onepagecheckout/css/so_onepagecheckout.css\');\r\n                        $this->load->model(\'localisation/country\');\r\n                        $data[\'countries\']  = $this->model_localisation_country->getCountries();\r\n                    }\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        \r\n        <operation error=\"log\">\r\n            <search ><![CDATA[$this->response->setOutput($this->load->view(\'checkout/checkout\', $data));]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                $this->load->model(\'setting/setting\');\r\n                $setting_so_onepagecheckout                 = $this->model_setting_setting->getSetting(\'so_onepagecheckout\');\r\n                if (isset($setting_so_onepagecheckout) && count($setting_so_onepagecheckout)>0) {\r\n                    $setting_so_onepagecheckout_general         = $setting_so_onepagecheckout[\'so_onepagecheckout_general\'];\r\n                    $setting_so_onepagecheckout_layout_setting  = $setting_so_onepagecheckout[\'so_onepagecheckout_layout_setting\'];\r\n\r\n                    if (isset($setting_so_onepagecheckout_general[\'so_onepagecheckout_enabled\']) && $setting_so_onepagecheckout_general[\'so_onepagecheckout_enabled\']) {\r\n                        if (isset($setting_so_onepagecheckout_layout_setting[\'so_onepagecheckout_account_open\']) && !empty($setting_so_onepagecheckout_layout_setting[\'so_onepagecheckout_account_open\'])) {\r\n                            $data[\'default_auth\'] = $setting_so_onepagecheckout_layout_setting[\'so_onepagecheckout_account_open\'];\r\n                        }\r\n                        else {\r\n                            $data[\'default_auth\'] = $this->getProperty($this->session->data, \'so_checkout_account\', \'register\');\r\n                        }\r\n\r\n                        $data[\'setting_so_onepagecheckout\']                 = $setting_so_onepagecheckout;\r\n                        $data[\'setting_so_onepagecheckout_general\']         = $setting_so_onepagecheckout_general;\r\n                        $data[\'setting_so_onepagecheckout_layout_setting\']  = $setting_so_onepagecheckout_layout_setting;\r\n                        \r\n                        $data[\'text_register\'] = $this->language->get(\'text_register\');\r\n                        $data[\'text_guest\'] = $this->language->get(\'text_guest\');\r\n                        $data[\'entry_email\'] = $this->language->get(\'entry_email\');\r\n                        $data[\'entry_password\'] = $this->language->get(\'entry_password\');\r\n                        $data[\'text_forgotten\'] = $this->language->get(\'text_forgotten\');\r\n                        $data[\'text_loading\'] = $this->language->get(\'text_loading\');\r\n                        $data[\'button_login\'] = $this->language->get(\'button_login\');\r\n                        $data[\'text_i_am_returning_customer\'] = $this->language->get(\'text_i_am_returning_customer\');\r\n                        $data[\'text_returning_customer\'] = $this->language->get(\'text_returning_customer\');\r\n                        $data[\'text_checkout_create_account_login\'] = $this->language->get(\'text_checkout_create_account_login\');\r\n\r\n                        $data[\'text_your_details\'] = $this->language->get(\'text_your_details\');\r\n                        $data[\'entry_customer_group\'] = $this->language->get(\'entry_customer_group\');\r\n                        $data[\'entry_firstname\'] = $this->language->get(\'entry_firstname\');\r\n                        $data[\'entry_lastname\'] = $this->language->get(\'entry_lastname\');\r\n                        $data[\'entry_telephone\'] = $this->language->get(\'entry_telephone\');\r\n                        $data[\'entry_fax\'] = $this->language->get(\'entry_fax\');\r\n                        $data[\'text_your_password\'] = $this->language->get(\'text_your_password\');\r\n                        $data[\'entry_confirm\'] = $this->language->get(\'entry_confirm\');\r\n                        $data[\'text_your_address\'] = $this->language->get(\'text_your_address\');\r\n                        $data[\'entry_shipping\'] = $this->language->get(\'entry_shipping\');\r\n                        $data[\'text_confirm_order\'] = $this->language->get(\'text_confirm_order\');\r\n\r\n                        // address data\r\n                        if ($this->isLoggedIn()) {\r\n                            $data[\'is_logged_in\'] = true;\r\n                            $data[\'payment_address\'] = $this->renderAddressForm(\'payment\');\r\n                            $data[\'shipping_address\'] = $this->renderAddressForm(\'shipping\');\r\n                            $data[\'register_form\'] = \'\';\r\n                        } else {\r\n                            $data[\'is_logged_in\'] = false;\r\n                            $data[\'allow_guest_checkout\'] = $this->allowGuestCheckout();\r\n                            $data[\'register_form\'] = $this->renderRegisterForm();\r\n                        }\r\n\r\n                        // shipping\r\n                        if ($this->isShippingRequired() && $setting_so_onepagecheckout_layout_setting[\'delivery_method_status\']) {\r\n                            $data[\'is_shipping_required\'] = true;\r\n                            $data[\'shipping_methods\'] = $this->shipping(true);\r\n                        } else {\r\n                            $data[\'is_shipping_required\'] = false;\r\n                        }\r\n\r\n                        // payment\r\n                        $data[\'payment_methods\'] = $this->payment(true);\r\n\r\n                        // coupon + voucher\r\n                        $data[\'coupon_voucher_reward\'] = $this->renderCouponVoucherReward();\r\n\r\n                        // cart\r\n                        if (isset($setting_so_onepagecheckout_layout_setting[\'shopping_cart_status\']) && $setting_so_onepagecheckout_layout_setting[\'shopping_cart_status\']) {\r\n                            $data[\'cart\'] = $this->cart(true);\r\n                        }\r\n                        else {\r\n                            $data[\'cart\'] = \'\';\r\n                        }\r\n\r\n                        // checkboxes\r\n                        if (!$this->isLoggedIn() && $this->config->get(\'config_account_id\')) {\r\n                            $this->load->model(\'catalog/information\');\r\n\r\n                            $information_info = $this->model_catalog_information->getInformation($this->config->get(\'config_account_id\'));\r\n\r\n                            if ($information_info) {\r\n                                $data[\'text_privacy\'] = sprintf($this->language->get(\'text_agree\'), $this->url->link(\'information/information/agree\', \'information_id=\' . $this->config->get(\'config_account_id\'), true), $information_info[\'title\'], $information_info[\'title\']);\r\n                            } else {\r\n                                $data[\'text_privacy\'] = \'\';\r\n                            }\r\n                        } else {\r\n                            $data[\'text_privacy\'] = \'\';\r\n                        }\r\n\r\n                        if ($this->config->get(\'config_checkout_id\')) {\r\n                            $this->load->model(\'catalog/information\');\r\n\r\n                            $information_info = $this->model_catalog_information->getInformation($this->config->get(\'config_checkout_id\'));\r\n\r\n                            if ($information_info) {\r\n                                $data[\'text_agree\'] = sprintf($this->language->get(\'text_agree\'), $this->url->link(\'information/information/agree\', \'information_id=\' . $this->config->get(\'config_checkout_id\'), true), $information_info[\'title\'], $information_info[\'title\']);\r\n                            } else {\r\n                                $data[\'text_agree\'] = \'\';\r\n                            }\r\n                        } else {\r\n                            $data[\'text_agree\'] = \'\';\r\n                        }\r\n\r\n                        if ($data[\'text_privacy\'] === $data[\'text_agree\']) {\r\n                            $data[\'text_privacy\'] = \'\';\r\n                        }\r\n\r\n                        $data[\'text_comments\'] = $this->language->get(\'text_comments\');\r\n\r\n                        if ($this->isLoggedIn()) {\r\n                            $data[\'entry_newsletter\'] = false;\r\n                        } else {\r\n                            $data[\'entry_newsletter\'] = sprintf($this->language->get(\'entry_newsletter\'), $this->config->get(\'config_name\'));\r\n                        }\r\n\r\n                        $data[\'comment\'] = $this->model_extension_module_so_onepagecheckout->getComment();\r\n\r\n                        if (isset($this->session->data[\'error\'])) {\r\n                            $data[\'error_warning\'] = $this->session->data[\'error\'];\r\n                            unset($this->session->data[\'error\']);\r\n                        } else {\r\n                            $data[\'error_warning\'] = \'\';\r\n                        }\r\n\r\n                        $data[\'customer_groups\'] = array();\r\n                        if (is_array($this->config->get(\'config_customer_group_display\'))) {\r\n                            $this->load->model(\'account/customer_group\');\r\n                \r\n                            $customer_groups = $this->model_account_customer_group->getCustomerGroups();\r\n                \r\n                            foreach ($customer_groups as $customer_group) {\r\n                                if (in_array($customer_group[\'customer_group_id\'], $this->config->get(\'config_customer_group_display\'))) {\r\n                                    $data[\'customer_groups\'][] = $customer_group;\r\n                                }\r\n                            }\r\n                        }\r\n                        if (isset($this->request->post[\'customer_group_id\'])) {\r\n                            $data[\'customer_group_id\'] = $this->request->post[\'customer_group_id\'];\r\n                        } else {\r\n                            $data[\'customer_group_id\'] = $this->config->get(\'config_customer_group_id\');\r\n                        }\r\n                        \r\n                        \r\n                        \r\n                        //Get cart\r\n                        $this->load->model(\'tool/image\');\r\n                        $this->load->model(\'tool/upload\');\r\n                        \r\n                        $data[\'products\'] = array();\r\n                        $products = $this->cart->getProducts();\r\n                        foreach ($products as $product) {\r\n                            $product_total = 0;\r\n                            \r\n                            foreach ($products as $product_2) {\r\n                                if ($product_2[\'product_id\'] == $product[\'product_id\']) {\r\n                                    $product_total += $product_2[\'quantity\'];\r\n                                }\r\n                            }\r\n                            \r\n                            if ($product[\'minimum\'] > $product_total) {\r\n                                $data[\'error_warning\'] = sprintf($this->language->get(\'error_minimum\'), $product[\'name\'], $product[\'minimum\']);\r\n                            }\r\n            \r\n                            if ($product[\'image\']) {\r\n                                $image = $this->model_tool_image->resize($product[\'image\'], $this->config->get(\'theme_\'.$this->config->get(\'config_theme\') . \'_image_cart_width\'), $this->config->get(\'theme_\'.$this->config->get(\'config_theme\') . \'_image_cart_height\'));\r\n                            } else {\r\n                                $image = \'\';\r\n                            }\r\n            \r\n                            $option_data = array();\r\n            \r\n                            foreach ($product[\'option\'] as $option) {\r\n                                if ($option[\'type\'] != \'file\') {\r\n                                    $value = $option[\'value\'];\r\n                                } else {\r\n                                    $upload_info = $this->model_tool_upload->getUploadByCode($option[\'value\']);\r\n            \r\n                                    if ($upload_info) {\r\n                                        $value = $upload_info[\'name\'];\r\n                                    } else {\r\n                                        $value = \'\';\r\n                                    }\r\n                                }\r\n            \r\n                                $option_data[] = array(\r\n                                    \'name\'  => $option[\'name\'],\r\n                                    \'value\' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . \'..\' : $value)\r\n                                );\r\n                            }\r\n            \r\n                            // Display prices\r\n                            if ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\r\n                                $unit_price = $this->tax->calculate($product[\'price\'], $product[\'tax_class_id\'], $this->config->get(\'config_tax\'));\r\n                                \r\n                                $price = $this->currency->format($unit_price, $this->session->data[\'currency\']);\r\n                                $total = $this->currency->format($unit_price * $product[\'quantity\'], $this->session->data[\'currency\']);\r\n                            } else {\r\n                                $price = false;\r\n                                $total = false;\r\n                            }\r\n            \r\n                            $recurring = \'\';\r\n            \r\n                            if ($product[\'recurring\']) {\r\n                                $frequencies = array(\r\n                                    \'day\'        => $this->language->get(\'text_day\'),\r\n                                    \'week\'       => $this->language->get(\'text_week\'),\r\n                                    \'semi_month\' => $this->language->get(\'text_semi_month\'),\r\n                                    \'month\'      => $this->language->get(\'text_month\'),\r\n                                    \'year\'       => $this->language->get(\'text_year\'),\r\n                                );\r\n            \r\n                                if ($product[\'recurring\'][\'trial\']) {\r\n                                    $recurring = sprintf($this->language->get(\'text_trial_description\'), $this->currency->format($this->tax->calculate($product[\'recurring\'][\'trial_price\'] * $product[\'quantity\'], $product[\'tax_class_id\'], $this->config->get(\'config_tax\')), $this->session->data[\'currency\']), $product[\'recurring\'][\'trial_cycle\'], $frequencies[$product[\'recurring\'][\'trial_frequency\']], $product[\'recurring\'][\'trial_duration\']) . \' \';\r\n                                }\r\n            \r\n                                if ($product[\'recurring\'][\'duration\']) {\r\n                                    $recurring .= sprintf($this->language->get(\'text_payment_description\'), $this->currency->format($this->tax->calculate($product[\'recurring\'][\'price\'] * $product[\'quantity\'], $product[\'tax_class_id\'], $this->config->get(\'config_tax\')), $this->session->data[\'currency\']), $product[\'recurring\'][\'cycle\'], $frequencies[$product[\'recurring\'][\'frequency\']], $product[\'recurring\'][\'duration\']);\r\n                                } else {\r\n                                    $recurring .= sprintf($this->language->get(\'text_payment_cancel\'), $this->currency->format($this->tax->calculate($product[\'recurring\'][\'price\'] * $product[\'quantity\'], $product[\'tax_class_id\'], $this->config->get(\'config_tax\')), $this->session->data[\'currency\']), $product[\'recurring\'][\'cycle\'], $frequencies[$product[\'recurring\'][\'frequency\']], $product[\'recurring\'][\'duration\']);\r\n                                }\r\n                            }\r\n            \r\n                            $data[\'products\'][] = array(\r\n                                \'cart_id\'   => $product[\'cart_id\'],\r\n                                \'thumb\'     => $image,\r\n                                \'name\'      => $product[\'name\'],\r\n                                \'model\'     => $product[\'model\'],\r\n                                \'option\'    => $option_data,\r\n                                \'recurring\' => $recurring,\r\n                                \'quantity\'  => $product[\'quantity\'],\r\n                                \'stock\'     => $product[\'stock\'] ? true : !(!$this->config->get(\'config_stock_checkout\') || $this->config->get(\'config_stock_warning\')),\r\n                                \'reward\'    => ($product[\'reward\'] ? sprintf($this->language->get(\'text_points\'), $product[\'reward\']) : \'\'),\r\n                                \'price\'     => $price,\r\n                                \'total\'     => $total,\r\n                                \'href\'      => $this->url->link(\'product/product\', \'product_id=\' . $product[\'product_id\'])\r\n                            );\r\n                        }\r\n                        \r\n                        // Gift Voucher\r\n                        $data[\'vouchers\'] = array();\r\n            \r\n                        if (!empty($this->session->data[\'vouchers\'])) {\r\n                            foreach ($this->session->data[\'vouchers\'] as $key => $voucher) {\r\n                                $data[\'vouchers\'][] = array(\r\n                                    \'key\'         => $key,\r\n                                    \'description\' => $voucher[\'description\'],\r\n                                    \'amount\'      => $this->currency->format($voucher[\'amount\'], $this->session->data[\'currency\']),\r\n                                    \'remove\'      => $this->url->link(\'checkout/cart\', \'remove=\' . $key)\r\n                                );\r\n                            }\r\n                        }\r\n                        \r\n                        // Totals\r\n                        $this->load->model(\'setting/extension\');\r\n            \r\n                        $totals = array();\r\n                        $taxes = $this->cart->getTaxes();\r\n                        $total = 0;\r\n                        \r\n                        // Because __call can not keep var references so we put them into an array.             \r\n                        $total_data = array(\r\n                            \'totals\' => &$totals,\r\n                            \'taxes\'  => &$taxes,\r\n                            \'total\'  => &$total\r\n                        );\r\n                        \r\n                        // Display prices\r\n                        if ($this->customer->isLogged() || !$this->config->get(\'config_customer_price\')) {\r\n                            $sort_order = array();\r\n            \r\n                            $results = $this->model_setting_extension->getExtensions(\'total\');\r\n            \r\n                            foreach ($results as $key => $value) {\r\n                                $sort_order[$key] = $this->config->get(\'total_\'.$value[\'code\'] . \'_sort_order\');\r\n                            }\r\n            \r\n                            array_multisort($sort_order, SORT_ASC, $results);\r\n            \r\n                            foreach ($results as $result) {\r\n                                if ($this->config->get(\'total_\'.$result[\'code\'] . \'_status\')) {\r\n                                    $this->load->model(\'extension/total/\' . $result[\'code\']);\r\n                                    \r\n                                    // We have to put the totals in an array so that they pass by reference.\r\n                                    $this->{\'model_extension_total_\' . $result[\'code\']}->getTotal($total_data);\r\n                                }\r\n                            }\r\n            \r\n                            $sort_order = array();\r\n            \r\n                            foreach ($totals as $key => $value) {\r\n                                $sort_order[$key] = $value[\'sort_order\'];\r\n                            }\r\n            \r\n                            array_multisort($sort_order, SORT_ASC, $totals);\r\n                        }\r\n            \r\n                        $data[\'totals\'] = array();\r\n                    \r\n                        foreach ($totals as $total) {\r\n                            $data[\'totals\'][] = array(\r\n                                \'title\' => $total[\'title\'],\r\n                                \'text\'  => $this->currency->format($total[\'value\'], $this->session->data[\'currency\'])\r\n                            );\r\n                        }\r\n                    }\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        \r\n        <operation error=\"log\">\r\n            <search ><![CDATA[$this->response->setOutput($this->load->view(\'checkout/checkout\', $data));]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                if (isset($setting_so_onepagecheckout_general[\'so_onepagecheckout_enabled\']) && $setting_so_onepagecheckout_general[\'so_onepagecheckout_enabled\']) {\r\n                    $data[\'forgotten\'] = $this->url->link(\'account/forgotten\', \'\', true);\r\n                    $this->model_extension_module_so_onepagecheckout->save();\r\n                    if ($setting_so_onepagecheckout_general[\'so_onepagecheckout_layout\'] == 1)\r\n                        $this->response->setOutput($this->load->view(\'extension/module/so_onepagecheckout/default\', $data));\r\n                    else if ($setting_so_onepagecheckout_general[\'so_onepagecheckout_layout\'] == 2)\r\n                        $this->response->setOutput($this->load->view(\'extension/module/so_onepagecheckout/default2\', $data));\r\n                }\r\n                else {\r\n                    $this->response->setOutput($this->load->view(\'checkout/checkout\', $data));\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n</modification>',1,'2018-09-14 11:51:57','2018-09-14 11:57:45'),(5,0,'So Mobile','so-mobile','OpenCartWorks','1.1.0','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n	<name><![CDATA[So Mobile]]></name>\r\n	<code>so-mobile</code>\r\n    <version><![CDATA[1.1.0]]></version>\r\n    <author><![CDATA[OpenCartWorks]]></author>\r\n	<link>http://www.opencartworks.com/</link>\r\n	\r\n	<!--========Catalog/controller/common=============-->\r\n    <file path=\"catalog/controller/common/home.php\">\r\n		<operation  >\r\n		<search ><![CDATA[$this->response->setOutput($this->load->view(\'common/home\', $data));]]></search>\r\n	    <add position=\"replace\"><![CDATA[\r\n	    	$soconfig 	= $this->soconfig;\r\n			$platforms_mobile 		= $soconfig->get_settings(\'platforms_mobile\');\r\n		    if($this->session->data[\'device\']==\'mobile\' && $platforms_mobile) $this->response->redirect($this->url->link(\'extension/mobile/home\'));\r\n		    else $this->response->setOutput($this->load->view(\'common/home\', $data));\r\n        ]]></add>\r\n   		</operation>\r\n	</file>\r\n	\r\n	<file path=\"catalog/controller/common/header.php\">\r\n		<operation  >\r\n			<search ><![CDATA[return $this->load->view(\'common/header\', $data)]]></search>\r\n			<add position=\"before\"><![CDATA[\r\n				$this->load->language(\'extension/soconfig/somobile\');\r\n				$data[\'menu_search\'] = $this->url->link(\'product/search\', \'\', true);\r\n				$data[\'mobile\'] = $this->soconfig;\r\n				$http = $_SERVER[\"HTTPS\"]  ? \'https://\' : \'http://\';\r\n				$data[\'actual_link\'] = $http.\"$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\r\n				$data[\'text_items\'] = sprintf($this->language->get(\'text_itemcount\'), $this->cart->countProducts() + (isset($this->session->data[\'vouchers\']) ? count($this->session->data[\'vouchers\']) : 0));\r\n				if($this->session->data[\'device\']==\'mobile\'){\r\n					$data[\'home\'] = $this->url->link(\'extension/mobile/home\');\r\n				}else{\r\n					$data[\'home\'] = $this->url->link(\'common/home\');\r\n				}\r\n				\r\n		]]></add>\r\n		</operation>\r\n	</file>\r\n	\r\n	<file path=\"catalog/controller/common/footer.php\">\r\n		<operation>\r\n			<search ><![CDATA[return $this->load->view(\'common/footer\', $data); ]]></search>\r\n			<add position=\"before\"><![CDATA[\r\n				// Menu Mobile\r\n				//Decodes HTML Entities\r\n         		$data[\'customfooter_text\'] = html_entity_decode($data[\'soconfig\']->get_settings(\'customfooter_text\'), ENT_QUOTES, \'UTF-8\');\r\n			\r\n			]]></add>\r\n		</operation>\r\n		\r\n	</file>\r\n	<!--End Catalog/controller/common-->\r\n	\r\n	<!--Catalog/controller/product-->\r\n	<file path=\"catalog/controller/product/category.php\">\r\n		<operation>\r\n			<search ><![CDATA[$data[\'heading_title\'] = $category_info[\'name\']]]></search>\r\n			<add position=\"before\"><![CDATA[$data[\'mobile\'] =$this->soconfig;]]></add>\r\n		</operation>\r\n	</file>\r\n	<file path=\"catalog/controller/product/{search,special,manufacturer}*.php\">\r\n		<operation>\r\n			<search ><![CDATA[$this->load->model(\'tool/image\')]]></search>\r\n			<add position=\"after\"><![CDATA[$data[\'mobile\'] = $this->soconfig;]]></add>\r\n		</operation> \r\n      \r\n    </file>\r\n	\r\n	<!--End Catalog/controller/product-->\r\n	\r\n</modification>   ',1,'2017-08-14 16:26:05','2018-04-16 14:30:40'),(6,0,'So Tools','ocmod-so-Tools','OpencartWorks','1.0.0','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?> \r\n<modification> \r\n <name>So Tools</name> \r\n <code>ocmod-so-Tools</code> \r\n <version>1.0.0</version> \r\n <author>OpencartWorks</author> \r\n <link>http://www.opencartworks.com/</link> \r\n \r\n <file path=\"catalog/controller/product/product.php\"> \r\n <operation> \r\n <search><![CDATA[$this->load->model(\'catalog/manufacturer\');]]></search> \r\n <add position=\"after\"><![CDATA[ \r\n $so_recent_products = array(); \r\n if (isset($this->request->cookie[\'sorecentproduct\'])) { \r\n $so_recent_products = explode(\',\', $this->request->cookie[\'sorecentproduct\']); \r\n } else if (isset($this->session->data[\'sorecentproduct\'])) { \r\n $so_recent_products = $this->session->data[\'sorecentproduct\']; \r\n } \r\n \r\n if (isset($this->request->get[\'route\']) && $this->request->get[\'route\'] == \'product/product\') { \r\n $product_id = $this->request->get[\'product_id\']; \r\n $so_recent_products = array_diff($so_recent_products, array($product_id)); \r\n array_unshift($so_recent_products, $product_id); \r\n setcookie(\'sorecentproduct\', implode(\',\', $so_recent_products), time() + 60 * 60 * 24 * 30, \'/\', $this->request->server[\'HTTP_HOST\']); \r\n if (!isset($this->session->data[\'sorecentproduct\']) || $this->session->data[\'sorecentproduct\'] != $so_recent_products) { \r\n $this->session->data[\'sorecentproduct\'] = $so_recent_products; \r\n } \r\n } \r\n ]]></add> \r\n </operation> \r\n </file> \r\n\r\n\r\n\r\n</modification>',1,'2017-09-05 14:50:51','2017-09-05 14:50:51'),(7,30,'Simple Blog','simpleblog','OpenCartWorks','3.1.0','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n	<name><![CDATA[Simple Blog]]></name>\n	<code>Simpleblog</code>\n    <version><![CDATA[3.1.0]]></version>\n    <author><![CDATA[OpenCartWorks]]></author>\n	\n    <link><![CDATA[http://www.opencartworks.com/]]></link>\n	<file path=\"admin/controller/common/column_left.php\">\n		<operation>\n            <search><![CDATA[$report = array();]]></search>\n            <add position=\"before\"><![CDATA[\n			// Simple Blog\n			$simpleblog = array();\n\n			if ($this->user->hasPermission(\'access\', \'extension/module/simple_blog/author\')) {\n				$simpleblog[] = array(\n					\'name\'	   => $this->language->get(\'text_simple_blog_author\'),\n					\'href\'     => $this->url->link(\'extension/module/simple_blog/author\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()\n				);\n			}\n\n			if ($this->user->hasPermission(\'access\', \'extension/module/simple_blog/article\')) {\n				$simpleblog[] = array(\n					\'name\'	   => $this->language->get(\'text_simple_blog_article\'),\n					\'href\'     => $this->url->link(\'extension/module/simple_blog/article\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()\n				);\n			}\n\n			if ($this->user->hasPermission(\'access\', \'extension/module/simple_blog/category\')) {\n				$simpleblog[] = array(\n					\'name\'	   => $this->language->get(\'text_simple_blog_category\'),\n					\'href\'     => $this->url->link(\'extension/module/simple_blog/category\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()\n				);\n			}\n\n			if ($this->user->hasPermission(\'access\', \'extension/module/simple_blog/comment\')) {\n				$simpleblog[] = array(\n					\'name\'	   => $this->language->get(\'text_simple_blog_article_comment\'),\n					\'href\'     => $this->url->link(\'extension/module/simple_blog/comment\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()\n				);\n			}\n\n			if ($this->user->hasPermission(\'access\', \'extension/module/simple_blog/report\')) {\n				$simpleblog[] = array(\n					\'name\'	   => $this->language->get(\'text_simple_blog_view_report\'),\n					\'href\'     => $this->url->link(\'extension/module/simple_blog/report\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n					\'children\' => array()\n				);\n			}\n\n			$simpleblogsettings = array();\n			\n			$simpleblogsettings[] = array(\n				\'name\'	   => $this->language->get(\'text_simple_blog_general_setting\'),\n				\'href\'     => $this->url->link(\'extension/module/simple_blog\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n				\'children\' => array()\n			);\n		\n			$simpleblogsettings[] = array(\n				\'name\'	   => $this->language->get(\'text_simple_blog_category_setting\'),\n				\'href\'     => $this->url->link(\'extension/module/simple_blog_category\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n				\'children\' => array()\n			);\n			\n			if ($simpleblogsettings) {\n				$simpleblog[] = array(\n					\'name\'	   => $this->language->get(\'text_simple_blog_setting\'),\n					\'href\'     => \'\',\n					\'children\' => $simpleblogsettings\n				);\n			}\n\n			if ($simpleblog) {\n				$data[\'menus\'][] = array(\n					\'id\'       => \'menu-simpleblog\',\n					\'icon\'	   => \'fa-file-text-o\',\n					\'name\'	   => $this->language->get(\'text_simple_blogs\'),\n					\'href\'     => \'\',\n					\'children\' => $simpleblog\n				);\n			}\n			]]></add>\n        </operation>\n	</file>\n	\n	<file path=\"admin/language/*/common/column_left.php\">\n        <operation>\n            <search><![CDATA[$_[\'text_other_status\']]]></search>\n            <add position=\"after\"><![CDATA[\n				$_[\'text_simple_blogs\']					= \'Simple Blog\';\n				$_[\'text_simple_blog_author\']			= \'Author\';\n				$_[\'text_simple_blog_category\']			= \'Category\';\n				$_[\'text_simple_blog_article\']			= \'Article\';\n				$_[\'text_simple_blog_article_comment\']	= \'Article Comment\';\n				$_[\'text_simple_blog_setting\'] 			= \'Setting\';\n				$_[\'text_simple_blog_general_setting\'] 	= \'General Setting\';\n				$_[\'text_simple_blog_category_setting\'] = \'Category Setting\';\n				$_[\'text_simple_blog_view_report\'] 		= \'Report\';\n			]]></add>\n        </operation>\n    </file>\n	<!--  End admin/controller-->\n	\n	<!--catalog/controller/common-->\n	<file path=\"catalog/controller/startup/seo_url.php\">\n		<operation>\n			<search><![CDATA[if ($query->row[\'query\'] && $url[0] != \'information_id\' && $url[0] != \'manufacturer_id\' && $url[0] != \'category_id\' && $url[0] != \'product_id\') {]]></search>\n			<add position=\"replace\"><![CDATA[\n				if ($query->row[\'query\'] && $url[0] != \'information_id\' && $url[0] != \'manufacturer_id\' && $url[0] != \'category_id\' && $url[0] != \'product_id\' && $url[0] != \'simple_blog_article_id\' && $url[0] != \'simple_blog_category_id\' && $url[0] != \'simple_blog_author_id\') {\n			]]></add>\n		</operation>\n       <operation>\n            <search><![CDATA[if ($url[0] == \'category_id\') {]]></search>\n            <add position=\"before\"><![CDATA[\n          		if($url[0] == \'simple_blog_article_id\') {					\n					$this->request->get[\'simple_blog_article_id\'] = $url[1];\n              	}\n				if($url[0] == \'simple_blog_author_id\') {\n					$this->request->get[\'simple_blog_author_id\'] = $url[1];\n              	}    			\n				if ($url[0] == \'simple_blog_category_id\') {\n					$this->request->get[\'simple_blog_category_id\'] = $url[1];\n				}         \n            ]]></add>\n        </operation>\n        \n        <operation>\n            <search><![CDATA[$this->request->get[\'route\'] = \'error/not_found\']]></search>\n            <add position=\"replace\"><![CDATA[\n          		if (($this->config->has(\'simple_blog_seo_keyword\')) && ($this->db->escape($part) == $this->config->get(\'simple_blog_seo_keyword\'))) {\n                    \n                } else if($this->db->escape($part) == \'simple-blog\') {\n                    \n                } else {\n                    $this->request->get[\'route\'] = \'error/not_found\';\n					break;\n               	}\n            ]]></add>\n        </operation>\n        \n        <operation>\n            <search><![CDATA[$this->request->get[\'route\'] = \'information/information\';]]></search>\n            <add position=\"replace\"><![CDATA[\n          			$this->request->get[\'route\'] = \'information/information\';\n  				} else if (isset($this->request->get[\'simple_blog_article_id\'])) {\n  					$this->request->get[\'route\'] = \'extension/simple_blog/article/view\';\n  				} else if (isset($this->request->get[\'simple_blog_author_id\'])) {\n  					$this->request->get[\'route\'] = \'extension/simple_blog/author\';\n  				} else if (isset($this->request->get[\'simple_blog_category_id\'])) {\n  					$this->request->get[\'route\'] = \'extension/simple_blog/category\';\n  				} else {\n            		if(($this->config->has(\'simple_blog_seo_keyword\'))) {\n                		if($this->request->get[\'_route_\'] == $this->config->get(\'simple_blog_seo_keyword\')) {\n                    		$this->request->get[\'route\'] = \'extension/simple_blog/article\';\n                		}\n            		}else {\n            			$this->request->get[\'route\'] = \'extension/simple_blog/article\';\n            		}\n            ]]></add>\n        </operation>\n        \n        <operation>\n            <search><![CDATA[} elseif ($key == \'path\') {]]></search>\n            <add position=\"replace\"><![CDATA[          \n				} else if($data[\'route\'] == \'extension/simple_blog/article/view\' && $key == \'simple_blog_article_id\') {					\n					$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"seo_url WHERE `query` = \'\" . $this->db->escape($key . \'=\' . (int)$value) . \"\' AND store_id = \'\" . (int)$this->config->get(\'config_store_id\') . \"\' AND language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\'\");\n					\n					if ($query->num_rows) {\n						$url .= \'/\' . $query->row[\'keyword\'];\n						unset($data[$key]);\n					}\n				} else if($data[\'route\'] == \'extension/simple_blog/author\' && $key == \'simple_blog_author_id\') {\n					$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"seo_url WHERE `query` = \'\" . $this->db->escape($key . \'=\' . (int)$value) . \"\' AND store_id = \'\" . (int)$this->config->get(\'config_store_id\') . \"\' AND language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\'\");\n					\n					if ($query->num_rows) {\n						$url .= \'/\' . $query->row[\'keyword\'];\n						unset($data[$key]);\n					}\n				} else if($data[\'route\'] == \'extension/simple_blog/category\' && $key == \'simple_blog_category_id\') {				\n					$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"seo_url WHERE `query` = \'\" . $this->db->escape($key . \'=\' . (int)$value) . \"\' AND store_id = \'\" . (int)$this->config->get(\'config_store_id\') . \"\' AND language_id = \'\" . (int)$this->config->get(\'config_language_id\') . \"\'\");\n					\n					if ($query->num_rows) {\n						$url .= \'/\' . $query->row[\'keyword\'];\n						unset($data[$key]);\n					}					\n				} else if($data[\'route\'] == \'extension/simple_blog/search\') {\n					if(isset($key) && ($key == \'blog_search\')) {\n						$url .= \'/search&blog_search=\' . $value;\n					}					\n				} else if(isset($data[\'route\']) && $data[\'route\'] == \'extension/simple_blog/article\' && $key != \'simple_blog_article_id\' && $key != \'simple_blog_author_id\' && $key != \'simple_blog_category_id\' && $key != \'page\') {				    \n                    if($this->config->has(\'simple_blog_seo_keyword\')) {\n                        $url .=  \'/\' . $this->config->get(\'simple_blog_seo_keyword\');\n                    }\n                    else {\n                    	$url .=  \'/simple-blog\';\n                    }                    \n				} elseif ($key == \'path\') {\n        \n            ]]></add>\n        </operation>\n        \n    </file>\n	\n	<file path=\"catalog/controller/common/header.php\">\n		<!--changes for Blog-->\n        <operation>\n            <search><![CDATA[$categories = $this->model_catalog_category->getCategories(0);]]></search>\n            <add position=\"after\"><![CDATA[\n				/***blog changes***/\n				$data[\'blog_link_status\'] = 1;\n				$data[\'blog_link_url\'] = \'index.php?route=simple_blog/article\';\n				if(isset($this->request->get[\'route\'])) {\n					$route = $this->request->get[\'route\'];\n				} else {\n					$route = \'common/home\';\n				}\n\n				$route = explode(\"/\", $route);\n\n				if($this->config->get(\'simple_blog_status\')) {\n    				$this->load->model(\'simple_blog/article\');\n\n    				$count_blog_categories = $this->model_simple_blog_article->getTotalCategories(0);\n                }\n\n				if (isset($count_blog_categories) && $this->config->get(\'simple_blog_display_category\') && $this->config->get(\'simple_blog_status\')) {\n\n					$categories = $this->model_simple_blog_article->getCategories(0);\n\n					foreach ($categories as $category) {\n						if ($category[\'top\']) {\n							// Level 2\n							$children_data = array();\n\n							$children = $this->model_simple_blog_article->getCategories($category[\'simple_blog_category_id\']);\n\n							foreach ($children as $child) {\n\n								$article_total = $this->model_simple_blog_article->getTotalArticles($child[\'simple_blog_category_id\']);\n                                if ($child[\'image\']) {\n                                    $this->load->model(\'tool/image\');\n\n                                    $image = $this->model_tool_image->resize($child[\'image\'], 205, 130);\n                                } else {\n                                    $image = false;\n                                }\n\n								$children_data[] = array(\n                                    \'image\'  => $image,\n								    \'external_link\' => $child[\'external_link\'],\n									\'name\'  => $child[\'name\'],\n									\'href\'  => $this->url->link(\'simple_blog/category\', \'simple_blog_category_id=\' . $category[\'simple_blog_category_id\'] . \'_\' . $child[\'simple_blog_category_id\'])\n								);\n							}\n\n							$menu_class = \'simple_blog\';\n\n							// Level 1\n							$data[\'categories\'][] = array(\n								\'name\'     => $category[\'name\'],\n								\'external_link\' => $category[\'external_link\'],\n								\'children\' => $children_data,\n								\'menu_class\' => $menu_class,\n								\'column\'   => $category[\'blog_category_column\'] ? $category[\'blog_category_column\'] : 1,\n								\'href\'     => $this->url->link(\'simple_blog/category\', \'simple_blog_category_id=\' . $category[\'simple_blog_category_id\'])\n							);\n						}\n					}\n				}\n				$categories = $this->model_catalog_category->getCategories(0);\n				/***end blog changes***/\n			]]></add>\n        </operation>\n	</file>\n</modification>  ',1,'2017-08-25 14:11:44','2017-08-25 14:11:44'),(8,0,'So Menu - OpenCartWorks','ocmod-menu-opencartwork','OpencartWorks','3.0.0','http://www.OpencartWorks.com','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n	<name><![CDATA[So Menu - OpenCartWorks]]></name>\r\n	<code>ocmod-menu-opencartwork</code>\r\n    <version><![CDATA[3.0.0]]></version>\r\n    <author><![CDATA[OpencartWorks]]></author>\r\n	<link>http://www.OpencartWorks.com</link>\r\n	\r\n<!-- ======= Show Menu Opencart For Navigation==========-->\r\n    <file path=\"admin/controller/common/column_left.php\">\r\n        <operation>\r\n			<search><![CDATA[$design = array();]]></search>\r\n			<add  position=\"before\"><![CDATA[\r\n				$magentech = array();\r\n				if ($this->user->hasPermission(\'access\', \'extension/module/soconfig\')) {		\r\n					$magentech[] = array(\r\n						\'name\'	   => \'So Themes Config\',\r\n						\'href\'     => $this->url->link(\'extension/module/soconfig\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n						\'children\' => array()\r\n					);\r\n				}\r\n				if ($this->user->hasPermission(\'access\', \'extension/module/somobile\')) {		\r\n					$magentech[] = array(\r\n						\'name\'	   => \'So Mobile\',\r\n						\'href\'     => $this->url->link(\'extension/module/somobile\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n						\'children\' => array()\r\n					);\r\n				}\r\n				if ($this->user->hasPermission(\'access\', \'extension/module/so_page_builder\')) {		\r\n					$magentech[] = array(\r\n						\'name\'	   => \'So Page Builder\',\r\n						\'href\'     => $this->url->link(\'extension/module/so_page_builder\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n						\'children\' => array()\r\n					);\r\n				}\r\n				if ($this->user->hasPermission(\'access\', \'extension/module/so_megamenu\')) {		\r\n					$magentech[] = array(\r\n						\'name\'	   => \'So Mega Menu\',\r\n						\'href\'     => $this->url->link(\'extension/module/so_megamenu\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n						\'children\' => array()\r\n					);\r\n				}\r\n				if ($this->user->hasPermission(\'access\', \'extension/module/so_searchpro\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Search Pro\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_searchpro\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_html_content\')) {   \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Html Content\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_html_content\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_home_slider\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Home Slider\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_home_slider\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                /*if ($this->user->hasPermission(\'access\', \'extension/module/so_filter_shop_by\')) {   \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Filter Shop By\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_filter_shop_by\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }*/\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_newletter_custom_popup\')) {   \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Newletter\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_newletter_custom_popup\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_deals\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Deals\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_deals\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_extra_slider\')) {   \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Extra Slider\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_extra_slider\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_sociallogin\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Social Login\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_sociallogin\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_listing_tabs\')) {   \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Listing Tabs\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_listing_tabs\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_categories\')) {   \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Categories\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_categories\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_popular_tags\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Popular Tags\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_popular_tags\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_quickview\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Quickview\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_quickview\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_onepagecheckout\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Onepage Checkout\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_onepagecheckout\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_latest_blog\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Latest Blog\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_latest_blog\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_instagram_gallery\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Instagram Gallery\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_instagram_gallery\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_countdown\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Countdown Popup\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_countdown\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n     \r\n				if ($this->user->hasPermission(\'access\', \'extension/module/so_call_for_price\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Call For Price\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_call_for_price\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_facebook_message\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Facebook Message\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_facebook_message\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n                if ($this->user->hasPermission(\'access\', \'extension/module/so_facebook\')) {    \r\n                  $magentech[] = array(\r\n                    \'name\'     => \'So Facebook\',\r\n                    \'href\'     => $this->url->link(\'extension/module/so_facebook\', \'user_token=\' . $this->session->data[\'user_token\'], true),\r\n                    \'children\' => array()\r\n                  );\r\n                }\r\n				if ($magentech) {					\r\n					$data[\'menus\'][] = array(\r\n						\'id\'       => \'menu-magentech\',\r\n						\'icon\'	   => \'fa-cubes icon-so\', \r\n						\'name\'	   => \'OpenCartWorks\',\r\n						\'href\'     => \'\',\r\n						\'children\' => $magentech\r\n					);		\r\n				}\r\n				\r\n				]]></add>\r\n				\r\n        </operation>\r\n    </file>\r\n</modification>                                                                                                                     ',1,'2017-09-04 09:04:58','2018-08-02 23:28:49'),(9,32,'So Color Swatch','So-color-swatch','OpenCartWorks','1.0.1','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>So Color Swatch</name>\r\n    <code>So-color-swatch</code>\r\n    <version>1.0.1</version>\r\n    <author>OpenCartWorks</author>\r\n    <link>http://www.opencartworks.com/</link>\r\n    \r\n    <file path=\"admin/controller/catalog/product.php\">\r\n        <operation>\r\n            <search><![CDATA[$data[\'layouts\'] = $this->model_design_layout->getLayouts();]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                $data[\'entry_default_image_color\'] = $this->language->get(\'entry_default_image_color\');\r\n                $data[\'entry_color\'] = $this->language->get(\'entry_color\');\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[$data[\'layouts\'] = $this->model_design_layout->getLayouts();]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                $this->load->model(\'extension/module/so_color_swatches_pro\');\r\n                $data[\'color_swatch\']   = $this->model_extension_module_so_color_swatches_pro->getColorSwatch();\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n			<search><![CDATA[$data[\'product_images\']]]></search>\r\n			<add position=\"before\"><![CDATA[\r\n				if(isset($product_image[\'default_of_color\'])){\r\n					$default_of_color = $product_image[\'default_of_color\'];\r\n				}else{\r\n					$default_of_color = array();\r\n				}           \r\n			]]></add>\r\n		</operation>\r\n		<operation>\r\n			<search><![CDATA[\'sort_order\' => $product_image[\'sort_order\']]]></search>\r\n			<add position=\"replace\"><![CDATA[\r\n				\'sort_order\' => $product_image[\'sort_order\'],\r\n				\'default_of_color\' => $default_of_color,                \r\n			]]></add>\r\n		</operation>\r\n    </file>\r\n    <file path=\"admin/view/template/catalog/product_form.twig\">\r\n        <operation>\r\n            <search><![CDATA[<td class=\"text-right\">{{ entry_sort_order }}</td>]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                <td class=\"text-right\">{{ entry_default_image_color }}</td>\r\n            ]]>\r\n            </add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<td class=\"text-right\"><input type=\"text\" name=\"product_image[{{ image_row }}][sort_order]\" value=\"{{ product_image.sort_order }}\" placeholder=\"{{ entry_sort_order }}\" class=\"form-control\"/></td>]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                <td class=\"text-right\">\r\n                    <select name=\"product_image[{{ image_row }}][default_of_color]\" class=\"default-color-selector\">\r\n                        <option value=\"0\">----------</option>\r\n                        {% for color in color_swatch %}\r\n                            {% if color.option_value_id == product_image.default_of_color %}\r\n                                <option value=\"{{ color.option_value_id }}\" selected=\"selected\">{{ color.name }}</option>\r\n                            {% else %}\r\n                                <option value=\"{{ color.option_value_id }}\">{{ color.name }}</option>\r\n                            {% endif %}\r\n                        {% endfor %}\r\n                    </select>\r\n                </td>\r\n            ]]>\r\n            </add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[{{ footer }}]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                <script type=\"text/javascript\"><!--\r\n                    jQuery(document).ready(function($){\r\n                        $(\'.default-color-selector\').change(function(){\r\n                            var value = $(this).val();\r\n                            $(\'.default-color-selector\').not(this).each(function(){\r\n                                if($(this).val()==value)\r\n                                    $(this).val(\'0\');\r\n                            });\r\n                        })\r\n                    });\r\n                //--></script>\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search index=\"2\"><![CDATA[<td colspan=\"2\"></td>]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                <td colspan=\"3\"></td>\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[html += \'  <td class=\"text-right\"><input type=\"text\" name=\"product_image[\' + image_row + \'][sort_order]\" value=\"\" placeholder=\"{{ entry_sort_order }}\" class=\"form-control\" /></td>\';]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                html += \'  <td class=\"text-right\">\';\r\n                html += \'  <select name=\"product_image[\' + image_row + \'][default_of_color]\" class=\"default-color-selector\">\';\r\n                html += \'  <option value=\"0\">----------</option>\';\r\n                {% for color in color_swatch %}\r\n                    html += \'  <option value=\"{{ color.option_value_id }}>\">{{ color.name }}</option>\';\r\n                {% endfor %}\r\n                html += \'  </select>\';\r\n                html += \'  </td>\';\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"admin/model/catalog/product.php\">\r\n        <operation>\r\n            <search><![CDATA[$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_image SET product_id = \'\" . (int)$product_id . \"\', image = \'\" . $this->db->escape($product_image[\'image\']) . \"\', sort_order = \'\" . (int)$product_image[\'sort_order\'] . \"\'\");]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                if ($this->checkProductImageColumnExist()) {\r\n                    $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_image SET product_id = \'\" . (int)$product_id . \"\', image = \'\" . $this->db->escape($product_image[\'image\']) . \"\', sort_order = \'\" . (int)$product_image[\'sort_order\'] . \"\', default_of_color = \'\". (int)$product_image[\'default_of_color\'] .\"\'\");\r\n                }\r\n                else {\r\n                    $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_image SET product_id = \'\" . (int)$product_id . \"\', image = \'\" . $this->db->escape($product_image[\'image\']) . \"\', sort_order = \'\" . (int)$product_image[\'sort_order\'] . \"\'\");\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[public function getTotalProductsByTaxClassId($tax_class_id) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                public function checkProductImageColumnExist() {\r\n                    $sql = \"SHOW COLUMNS FROM \" .DB_PREFIX. \"product_image LIKE \'default_of_color\'\";\r\n                    $query = $this->db->query($sql);\r\n                    return count($query->rows)>0 ? true : false;\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"admin/language/*/catalog/product.php\">\r\n        <operation>\r\n             <search><![CDATA[// Entry]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                $_[\'entry_default_image_color\']        = \'Default Image For Color\';\r\n                $_[\'entry_color\']        = \'Color\';\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/controller/product/category.php\">\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'][] = array(]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                $option_data = array();\r\n                $image_data = array();\r\n                if ($this->config->get(\'module_so_color_swatches_pro_status\') && $this->config->get(\'module_so_color_swatches_pro_enable_product_list\')) {\r\n                    $this->load->model(\'extension/module/so_color_swatches_pro\');\r\n                    $data[\'width_product_list\'] = (int)$this->config->get(\'module_so_color_swatches_pro_width_product_list\');\r\n                    if ($data[\'width_product_list\'] == 0) {\r\n                        $data[\'width_product_list\'] = 15;\r\n                    }\r\n                    $data[\'height_product_list\'] = (int)$this->config->get(\'module_so_color_swatches_pro_height_product_list\');\r\n                    if ($data[\'height_product_list\'] == 0) {\r\n                        $data[\'height_product_list\'] = 15;\r\n                    }\r\n                    $data[\'colorswatch_type\'] = $this->config->get(\'module_so_color_swatches_pro_type\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_color_swatches_pro/css/style.css\');\r\n\r\n                    $options = $this->model_extension_module_so_color_swatches_pro->getProductOptions($result[\'product_id\']);\r\n                    foreach ($options as $option) {\r\n                        $product_option_value_data = array();\r\n                        foreach ($option[\'product_option_value\'] as $option_value) {\r\n                            if (!$option_value[\'subtract\'] || ($option_value[\'quantity\'] > 0)) {\r\n                                $p_image = $this->model_extension_module_so_color_swatches_pro->getProductImages($result[\'product_id\'], $option_value[\'option_value_id\']);\r\n                                if (isset($p_image[\'image\']) && $p_image[\'image\']) {\r\n                                    $pimage = $this->model_tool_image->resize($p_image[\'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\'));\r\n                                } else {\r\n                                    $pimage = \'\';\r\n                                }\r\n                                if (isset($p_image[\'product_image_id\']) && $p_image[\'product_image_id\']) {\r\n                                    $product_image_id = $p_image[\'product_image_id\'];\r\n                                }\r\n                                else {\r\n                                    $product_image_id = \'\';\r\n                                }\r\n                                $product_option_value_data[] = array(\r\n                                    \'product_option_value_id\' => $option_value[\'product_option_value_id\'],\r\n                                    \'option_value_id\'         => $option_value[\'option_value_id\'],\r\n                                    \'name\'                    => $option_value[\'name\'],\r\n                                    \'image\'                   => $this->model_tool_image->resize($option_value[\'image\'], $data[\'width_product_list\'], $data[\'height_product_list\']),\r\n                                    \'price\'                   => $price,\r\n                                    \'price_prefix\'            => $option_value[\'price_prefix\'],\r\n                                    \'color_image\'             => $pimage,\r\n                                    \'product_image_id\'        => $product_image_id\r\n                                );\r\n                            }\r\n                        }\r\n                        $option_data[] = array(\r\n                            \'product_option_id\'    => $option[\'product_option_id\'],\r\n                            \'product_option_value\' => $product_option_value_data,\r\n                            \'option_id\'            => $option[\'option_id\'],\r\n                            \'name\'                 => $option[\'name\'],\r\n                            \'type\'                 => $option[\'type\'],\r\n                            \'value\'                => $option[\'value\'],\r\n                            \'required\'             => $option[\'required\']\r\n                        );\r\n                    }\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'][] = array]]></search>\r\n            <add position=\"after\" trim=\"true\" offset=\"1\"><![CDATA[\r\n                \'option\'      => $option_data,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/controller/product/{search,manufacturer,special}*.php\">\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'][] = array(]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                $option_data = array();\r\n                $image_data = array();\r\n                if ($this->config->get(\'module_so_color_swatches_pro_status\')) {\r\n                    $this->load->model(\'extension/module/so_color_swatches_pro\');\r\n                    $data[\'width_product_list\'] = (int)$this->config->get(\'module_so_color_swatches_pro_width_product_list\');\r\n                    if ($data[\'width_product_list\'] == 0) {\r\n                        $data[\'width_product_list\'] = 15;\r\n                    }\r\n                    $data[\'height_product_list\'] = (int)$this->config->get(\'module_so_color_swatches_pro_height_product_list\');\r\n                    if ($data[\'height_product_list\'] == 0) {\r\n                        $data[\'height_product_list\'] = 15;\r\n                    }\r\n                    $data[\'colorswatch_type\'] = $this->config->get(\'module_so_color_swatches_pro_type\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_color_swatches_pro/css/style.css\');\r\n\r\n                    $options = $this->model_extension_module_so_color_swatches_pro->getProductOptions($result[\'product_id\']);\r\n                    foreach ($options as $option) {\r\n                        $product_option_value_data = array();\r\n                        foreach ($option[\'product_option_value\'] as $option_value) {\r\n                            if (!$option_value[\'subtract\'] || ($option_value[\'quantity\'] > 0)) {\r\n                                $p_image = $this->model_extension_module_so_color_swatches_pro->getProductImages($result[\'product_id\'], $option_value[\'option_value_id\']);\r\n                                if (isset($p_image[\'image\']) && $p_image[\'image\']) {\r\n                                    $pimage = $this->model_tool_image->resize($p_image[\'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\'));\r\n                                } else {\r\n                                    $pimage = \'\';\r\n                                }\r\n                                if (isset($p_image[\'product_image_id\']) && $p_image[\'product_image_id\']) {\r\n                                    $product_image_id = $p_image[\'product_image_id\'];\r\n                                }\r\n                                else {\r\n                                    $product_image_id = \'\';\r\n                                }\r\n                                $product_option_value_data[] = array(\r\n                                    \'product_option_value_id\' => $option_value[\'product_option_value_id\'],\r\n                                    \'option_value_id\'         => $option_value[\'option_value_id\'],\r\n                                    \'name\'                    => $option_value[\'name\'],\r\n                                    \'image\'                   => $this->model_tool_image->resize($option_value[\'image\'], $data[\'width_product_list\'], $data[\'height_product_list\']),\r\n                                    \'price\'                   => $price,\r\n                                    \'price_prefix\'            => $option_value[\'price_prefix\'],\r\n                                    \'color_image\'             => $pimage,\r\n                                    \'product_image_id\'        => $product_image_id\r\n                                );\r\n                            }\r\n                        }\r\n                        $option_data[] = array(\r\n                            \'product_option_id\'    => $option[\'product_option_id\'],\r\n                            \'product_option_value\' => $product_option_value_data,\r\n                            \'option_id\'            => $option[\'option_id\'],\r\n                            \'name\'                 => $option[\'name\'],\r\n                            \'type\'                 => $option[\'type\'],\r\n                            \'value\'                => $option[\'value\'],\r\n                            \'required\'             => $option[\'required\']\r\n                        );\r\n                    }\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'][] = array]]></search>\r\n            <add position=\"after\" trim=\"true\" offset=\"1\"><![CDATA[\r\n                \'option\'      => $option_data,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    \r\n    <file path=\"catalog/view/theme/*/template/soconfig/listing.twig\">\r\n        <operation>\r\n            <search><![CDATA[<img  data-sizes=\"auto\" src=\"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" data-src=\"{{ product.thumb }}\"  title=\"{{ product.name }} \" class=\"lazyload img-responsive\" />]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                <img src=\"{{ product.thumb }}\" alt=\"{{ product.name }}\" title=\"{{ product.name }}\" class=\"img-responsive\" id=\"product-image-{{ product.product_id }}\" />\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<h4><a href=\"{{ product.href }}\">{{ product.name }} </a></h4>]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                {% if product.option %}\r\n                <ul class=\"so-productlist-colorswatch\" id=\"colorswatch-{{ product.product_id }}\">\r\n                    {% for option in product.option %}\r\n                        {% if option.type == \'select\' %}\r\n                            {% for option_value in option.product_option_value %}\r\n                                 <li class=\"colorswatch{{option_value.product_option_value_id~option_value.option_value_id~product.product_id }}\">\r\n                                    <a href=\"javascript:void(0);\" title=\"{{ option_value.name }}\" style=\"width: {{ width_product_list }}px; height: {{ height_product_list }}px; background-image: url(\'{{ option_value.image }}\')\"></a>\r\n                                    <script type=\"text/javascript\">\r\n                                        jQuery(document).ready(function($) {\r\n                                            var $window_width = $(window).width();\r\n                                            {% if colorswatch_type == \'click\' %}\r\n                                                $(document).on(\'click\', \'.so-productlist-colorswatch li.colorswatch{{ option_value.product_option_value_id~option_value.option_value_id~product.product_id }}\', function(e) {\r\n                                                    e.preventDefault();\r\n                                                    {% if option_value.color_image %}\r\n                                                        jQuery(\'img#product-image-{{product.product_id }}\').attr(\'src\', \'{{ option_value.color_image }}\');\r\n                                                    {% endif %}\r\n                                                    \r\n                                                    $(\'.so-productlist-colorswatch li\').removeClass(\'actived\');\r\n                                                    $(this).removeClass(\'actived\').addClass(\'actived\');\r\n                                                });\r\n                                            {% else %}\r\n                                                if ($window_width > 1199) {\r\n                                                    $(\'.so-productlist-colorswatch li.colorswatch{{ option_value.product_option_value_id~option_value.option_value_id~product.product_id }}\').hover(function(e) {\r\n                                                        e.preventDefault();\r\n                                                        {% if option_value.color_image %}\r\n                                                            jQuery(\'img#product-image-{{product.product_id }}\').attr(\'src\', \'{{ option_value.color_image }}\');\r\n                                                        {% endif %}\r\n                                                        \r\n                                                        $(\'.so-productlist-colorswatch li\').removeClass(\'actived\');\r\n                                                        $(this).removeClass(\'actived\').addClass(\'actived\');\r\n                                                    });\r\n                                                }\r\n                                                else {\r\n                                                    $(document).on(\'click\', \'.so-productlist-colorswatch li.colorswatch{{ option_value.product_option_value_id~option_value.option_value_id~product.product_id }}\', function(e) {\r\n                                                        e.preventDefault();\r\n                                                        {% if option_value.color_image %}\r\n                                                            jQuery(\'img#product-image-{{product.product_id }}\').attr(\'src\', \'{{ option_value.color_image }}\');\r\n                                                        {% endif %}\r\n                                                        \r\n                                                        $(\'.so-productlist-colorswatch li\').removeClass(\'actived\');\r\n                                                        $(this).removeClass(\'actived\').addClass(\'actived\');\r\n                                                    });\r\n                                                }\r\n                                            {% endif %}\r\n                                        })\r\n                                    </script>\r\n                                </li>\r\n                            {% endfor %}\r\n                        {% endif %}\r\n                    {% endfor %}\r\n                </ul>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/controller/product/product.php\">\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'] = array();]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                $data[\'option_data\'] = array();\r\n                if ($this->config->get(\'module_so_color_swatches_pro_status\') && $this->config->get(\'module_so_color_swatches_pro_enable_product_page\')) {\r\n                    $data[\'width_product_page\'] = $this->config->get(\'module_so_color_swatches_pro_width_product_page\');\r\n                    if ($data[\'width_product_page\'] == 0) {\r\n                        $data[\'width_product_page\'] = 20;\r\n                    }\r\n                    $data[\'height_product_page\'] = $this->config->get(\'module_so_color_swatches_pro_height_product_page\');\r\n                    if ($data[\'height_product_page\'] == 0) {\r\n                        $data[\'height_product_page\'] = 20;\r\n                    }\r\n                    $data[\'colorswatch_type\'] = $this->config->get(\'module_so_color_swatches_pro_type\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_color_swatches_pro/css/style.css\');\r\n                    \r\n                    $this->load->model(\'extension/module/so_color_swatches_pro\');\r\n                    $option_selected = $this->config->get(\'module_so_color_swatches_pro_option\');\r\n                    $product_option = $this->model_extension_module_so_color_swatches_pro->getProductOptionsByOptionId($this->request->get[\'product_id\'], $option_selected);\r\n                    if ($product_option) {\r\n                        $data[\'product_option_id\'] = $product_option[\'product_option_id\'];\r\n                    }\r\n                    $data[\'option_selected\'] = $option_selected;\r\n    \r\n                    $options = $this->model_extension_module_so_color_swatches_pro->getProductOptions($this->request->get[\'product_id\']);\r\n                    foreach ($options as $option) {\r\n                        $product_option_value_data = array();\r\n                        foreach ($option[\'product_option_value\'] as $option_value) {\r\n                            if (!$option_value[\'subtract\'] || ($option_value[\'quantity\'] > 0)) {\r\n                                $p_image = $this->model_extension_module_so_color_swatches_pro->getProductImages($this->request->get[\'product_id\'], $option_value[\'option_value_id\']);\r\n                                if (isset($p_image[\'image\']) && $p_image[\'image\']) {\r\n                                    $pimage = $this->model_tool_image->resize($p_image[\'image\'], $this->config->get(\'theme_\'.$this->config->get(\'config_theme\') . \'_image_popup_width\'), $this->config->get(\'theme_\'.$this->config->get(\'config_theme\') . \'_image_popup_height\'));\r\n                                    $p_thumbimage = $this->model_tool_image->resize($p_image[\'image\'], $this->config->get(\'theme_\'.$this->config->get(\'config_theme\') . \'_image_thumb_width\'), $this->config->get(\'theme_\'.$this->config->get(\'config_theme\') . \'_image_thumb_height\'));\r\n                                } else {\r\n                                    $pimage = \'\';\r\n                                    $p_thumbimage = \'\';\r\n                                }\r\n                                if (isset($p_image[\'product_image_id\']) && $p_image[\'product_image_id\']) {\r\n                                    $product_image_id = $p_image[\'product_image_id\'];\r\n                                }\r\n                                else {\r\n                                    $product_image_id = \'\';\r\n                                }\r\n                                $product_option_value_data[] = array(\r\n                                    \'product_option_value_id\' => $option_value[\'product_option_value_id\'],\r\n                                    \'option_value_id\'         => $option_value[\'option_value_id\'],\r\n                                    \'name\'                    => $option_value[\'name\'],\r\n                                    \'image\'                   => $this->model_tool_image->resize($option_value[\'image\'], $data[\'width_product_page\'], $data[\'height_product_page\']),\r\n                                    \'price\'                   => $price,\r\n                                    \'price_prefix\'            => $option_value[\'price_prefix\'],\r\n                                    \'color_image\'             => $pimage,\r\n                                    \'color_thumb_image\'       => $p_thumbimage,\r\n                                    \'product_image_id\'        => $product_image_id\r\n                                );\r\n                            }\r\n                        }\r\n                        $data[\'option_data\'][] = array(\r\n                            \'product_option_id\'    => $option[\'product_option_id\'],\r\n                            \'product_option_value\' => $product_option_value_data,\r\n                            \'option_id\'            => $option[\'option_id\'],\r\n                            \'name\'                 => $option[\'name\'],\r\n                            \'type\'                 => $option[\'type\'],\r\n                            \'value\'                => $option[\'value\'],\r\n                            \'required\'             => $option[\'required\']\r\n                        );\r\n                    }\r\n                }\r\n                $data[\'option_data\'] = array_shift($data[\'option_data\']);\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/view/theme/*/template/product/product.twig\">\r\n        <operation>\r\n            <search><![CDATA[<h3>{{ text_option }}</h3>]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                {% if option_data and option_data.product_option_value is defined and option_data.product_option_value %}\r\n                    <ul id=\"so-colorswatch-selector-{{ product_id }}\" class=\'so-colorswatch-productpage-icons\'>\r\n                        {% for option_value in option_data.product_option_value %}\r\n                            <li class=\"option-item\">\r\n                                <a class=\"\" \r\n                                    data-product-option-value-id=\"{{ option_value.product_option_value_id }}\" \r\n                                    data-option-value-id=\"{{ option_value.option_value_id }}\" \r\n                                    data-color-image=\"{{ option_value.color_image }}\" \r\n                                    data-color-thumb-image=\"{{ option_value.color_thumb_image }}\" \r\n                                    style=\"width: {{ width_product_page }}px; height: {{ height_product_page }}px; background-image: url(\'{{ option_value.image }}\')\">\r\n                                </a>\r\n                            </li>\r\n                        {% endfor %}\r\n                        <li class=\"selected-option\"><span></span></li>\r\n                    </ul>\r\n                    <script type=\"text/javascript\">\r\n                        var $window_width = $(window).width();\r\n                        var ProductOptionId = \'{{ product_option_id }}\';\r\n                        var default_image = $(\'.large-image img\').attr(\'src\');\r\n                        jQuery(document).ready(function($) {\r\n                            $(\'#input-option{{ product_option_id }}\').parent().hide();\r\n    \r\n                            $(\'#input-option{{ product_option_id}} option\').each(function(){\r\n                              var text = $(this).text().replace(/\\s{2,}/g, \' \');\r\n                              var val = $(this).attr(\'value\');\r\n                              $(\'.so-colorswatch-productpage-icons li a\').each(function(index, el){\r\n                                if($(el).data(\'product-option-value-id\')== val){\r\n                                  $(el).attr(\'title\', text);\r\n                                }\r\n                              })\r\n                            })\r\n                            \r\n                            {% if colorswatch_type == \'click\' %}\r\n                                $(document).on(\'click\', \'.so-colorswatch-productpage-icons li.option-item\', function(e){\r\n                                    e.preventDefault();\r\n                                    var option_value_id = $(this).children(\'a\').data(\'product-option-value-id\');\r\n                                    var option_id = $(this).children(\'a\').data(\'option-value-id\');\r\n        \r\n                                    if ($(this).hasClass(\'checked\')) {\r\n                                        $(\'.so-colorswatch-productpage-icons li.option-item\').removeClass(\'checked\');\r\n                                        $(this).removeClass(\'checked\');\r\n                                        $(\'#input-option{{ product_option_id }}\').val(\'\').trigger(\'change\');\r\n                                        $(\'.so-colorswatch-productpage-icons li.selected-option > span\').html(\'\');\r\n                                        \r\n                                        $(\'.large-image img\').attr(\'src\', default_image);\r\n                                    }\r\n                                    else {\r\n                                        $(\'.so-colorswatch-productpage-icons li.option-item\').removeClass(\'checked\');\r\n                                        $(this).removeClass(\'checked\').addClass(\'checked\');\r\n                                        $(\'#input-option{{ product_option_id }}\').val(option_value_id).trigger(\'change\');\r\n                                        $(\'.so-colorswatch-productpage-icons li.selected-option > span\').html($(this).children(\'a\').attr(\'title\'));\r\n                                        \r\n                                        if ($(this).children(\'a\').data(\'color-image\') != \'\') {\r\n                                            $(\'.large-image img\').attr(\'src\', $(this).children(\'a\').data(\'color-image\'));\r\n                                        }\r\n                                        else {\r\n                                            $(\'.large-image img\').attr(\'src\', default_image);\r\n                                        }\r\n\r\n                                        $(\'#thumb-slider  a.thumbnail\').removeClass(\'active\');\r\n                                    }\r\n                                })\r\n                            {% else %}\r\n                                if ($window_width > 1199) {\r\n                                    $(\'.so-colorswatch-productpage-icons li.option-item\').hover(function(e){\r\n                                        e.preventDefault();\r\n                                        var option_value_id = $(this).children(\'a\').data(\'product-option-value-id\');\r\n                                        var option_id = $(this).children(\'a\').data(\'option-value-id\');\r\n                                        \r\n                                        $(\'.so-colorswatch-productpage-icons li.option-item\').removeClass(\'checked\');\r\n                                        if ($(this).hasClass(\'checked\')) {\r\n                                            $(this).removeClass(\'checked\');\r\n                                            $(\'#input-option{{ product_option_id }}\').val(\'\').trigger(\'change\');\r\n                                            $(\'.large-image img\').attr(\'src\', default_image);\r\n                                           \r\n                                        }\r\n                                        else {\r\n                                            $(this).removeClass(\'checked\').addClass(\'checked\');\r\n                                            $(\'#input-option{{ product_option_id }}\').val(option_value_id).trigger(\'change\');\r\n                                            $(\'.so-colorswatch-productpage-icons li.selected-option > span\').html($(this).children(\'a\').attr(\'title\'));\r\n                                            \r\n                                            if ($(this).children(\'a\').data(\'color-image\') != \'\') {\r\n	                                            $(\'.large-image img\').attr(\'src\', $(this).children(\'a\').data(\'color-image\'));\r\n	                                        }\r\n	                                        else {\r\n	                                            $(\'.large-image img\').attr(\'src\', default_image);\r\n	                                        }\r\n	                                         $(\'#thumb-slider  a.thumbnail\').removeClass(\'active\');\r\n                                        }\r\n                                    });\r\n                                }\r\n                                else {\r\n                                    $(document).on(\'click\', \'.so-colorswatch-productpage-icons li.option-item\', function(e){\r\n                                        e.preventDefault();\r\n                                        var option_value_id = $(this).children(\'a\').data(\'product-option-value-id\');\r\n                                        var option_id = $(this).children(\'a\').data(\'option-value-id\');\r\n            \r\n                                        $(\'.so-colorswatch-productpage-icons li.option-item\').removeClass(\'checked\');\r\n                                        if ($(this).hasClass(\'checked\')) {\r\n                                            $(this).removeClass(\'checked\');\r\n                                            $(\'#input-option{{ product_option_id }}\').val(\'\').trigger(\'change\');\r\n                                            $(\'.large-image img\').attr(\'src\', default_image);\r\n                                           \r\n                                        }\r\n                                        else {\r\n                                            $(this).removeClass(\'checked\').addClass(\'checked\');\r\n                                            $(\'#input-option{{ product_option_id }}\').val(option_value_id).trigger(\'change\');\r\n                                            $(\'.so-colorswatch-productpage-icons li.selected-option > span\').html($(this).children(\'a\').attr(\'title\'));\r\n                                            \r\n                                            if ($(this).children(\'a\').data(\'color-image\') != \'\') {\r\n	                                            $(\'.large-image img\').attr(\'src\', $(this).children(\'a\').data(\'color-image\'));\r\n	                                        }\r\n	                                        else {\r\n	                                            $(\'.large-image img\').attr(\'src\', default_image);\r\n	                                        }\r\n	                                         $(\'#thumb-slider  a.thumbnail\').removeClass(\'active\');\r\n                                        }\r\n                                    })\r\n                                }\r\n                            {% endif %}\r\n                        })                  \r\n                    </script>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[var element = $(\'#input-option\' + i.replace(\'_\', \'-\'));]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n				{% if option_data %}\r\n					if(ProductOptionId != undefined && ProductOptionId==i.replace(\'_\', \'-\')){\r\n						$(\'.so-colorswatch-productpage-icons\').after(\'<div class=\"text-danger\">\' + json[\'error\'][\'option\'][i] + \'</div>\');\r\n					}\r\n				{% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/controller/extension/module/featured.php\">\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'][] = array(]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                $option_data = array();\r\n                $image_data = array();\r\n                if ($this->config->get(\'module_so_color_swatches_pro_status\')) {\r\n                    $data[\'color_swatch_status\'] = $this->config->get(\'module_so_color_swatches_pro_status\');\r\n                    $data[\'enable_product_list\'] = $this->config->get(\'module_so_color_swatches_pro_enable_product_list\');\r\n                    $data[\'width_product_list\'] = (int)$this->config->get(\'module_so_color_swatches_pro_width_product_list\');\r\n                    if ($data[\'width_product_list\'] == 0) {\r\n                        $data[\'width_product_list\'] = 15;\r\n                    }\r\n                    $data[\'height_product_list\'] = (int)$this->config->get(\'module_so_color_swatches_pro_height_product_list\');\r\n                    if ($data[\'height_product_list\'] == 0) {\r\n                        $data[\'height_product_list\'] = 15;\r\n                    }\r\n                    $data[\'colorswatch_type\'] = $this->config->get(\'module_so_color_swatches_pro_type\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_color_swatches_pro/css/style.css\');\r\n                \r\n                    $this->load->model(\'extension/module/so_color_swatches_pro\');\r\n                    $options = $this->model_extension_module_so_color_swatches_pro->getProductOptions($product_info[\'product_id\']);\r\n                    foreach ($options as $option) {\r\n                        $product_option_value_data = array();\r\n                        foreach ($option[\'product_option_value\'] as $option_value) {\r\n                            if (!$option_value[\'subtract\'] || ($option_value[\'quantity\'] > 0)) {\r\n                                $p_image = $this->model_extension_module_so_color_swatches_pro->getProductImages($product_info[\'product_id\'], $option_value[\'option_value_id\']);\r\n                                if (isset($p_image[\'image\']) && $p_image[\'image\']) {\r\n                                    $pimage = $this->model_tool_image->resize($p_image[\'image\'], $setting[\'width\'], $setting[\'height\']);\r\n                                } else {\r\n                                    $pimage = \'\';\r\n                                }\r\n                                if (isset($p_image[\'product_image_id\']) && $p_image[\'product_image_id\']) {\r\n                                    $product_image_id = $p_image[\'product_image_id\'];\r\n                                }\r\n                                else {\r\n                                    $product_image_id = \'\';\r\n                                }\r\n                                $product_option_value_data[] = array(\r\n                                    \'product_option_value_id\' => $option_value[\'product_option_value_id\'],\r\n                                    \'option_value_id\'         => $option_value[\'option_value_id\'],\r\n                                    \'name\'                    => $option_value[\'name\'],\r\n                                    \'image\'                   => $this->model_tool_image->resize($option_value[\'image\'], $data[\'width_product_list\'], $data[\'height_product_list\']),\r\n                                    \'price\'                   => $price,\r\n                                    \'price_prefix\'            => $option_value[\'price_prefix\'],\r\n                                    \'color_image\'             => $pimage,\r\n                                    \'product_image_id\'        => $product_image_id\r\n                                );\r\n                            }\r\n                        }\r\n                        $option_data[] = array(\r\n                            \'product_option_id\'    => $option[\'product_option_id\'],\r\n                            \'product_option_value\' => $product_option_value_data,\r\n                            \'option_id\'            => $option[\'option_id\'],\r\n                            \'name\'                 => $option[\'name\'],\r\n                            \'type\'                 => $option[\'type\'],\r\n                            \'value\'                => $option[\'value\'],\r\n                            \'required\'             => $option[\'required\']\r\n                        );\r\n                    }\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'product_id\'  => $product_info[\'product_id\'],]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'option\'      => $option_data,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/controller/extension/module/{bestseller,latest,special}*.php\">\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'][] = array(]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                $option_data = array();\r\n                $image_data = array();\r\n                if ($this->config->get(\'module_so_color_swatches_pro_status\')) {\r\n                    $data[\'color_swatch_status\'] = $this->config->get(\'module_so_color_swatches_pro_status\');\r\n                    $data[\'enable_product_list\'] = $this->config->get(\'module_so_color_swatches_pro_enable_product_list\');\r\n                    $data[\'width_product_list\'] = (int)$this->config->get(\'module_so_color_swatches_pro_width_product_list\');\r\n                    if ($data[\'width_product_list\'] == 0) {\r\n                        $data[\'width_product_list\'] = 15;\r\n                    }\r\n                    $data[\'height_product_list\'] = (int)$this->config->get(\'module_so_color_swatches_pro_height_product_list\');\r\n                    if ($data[\'height_product_list\'] == 0) {\r\n                        $data[\'height_product_list\'] = 15;\r\n                    }\r\n                    $data[\'colorswatch_type\'] = $this->config->get(\'module_so_color_swatches_pro_type\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_color_swatches_pro/css/style.css\');\r\n                \r\n                    $this->load->model(\'extension/module/so_color_swatches_pro\');\r\n                    $options = $this->model_extension_module_so_color_swatches_pro->getProductOptions($result[\'product_id\']);\r\n                    foreach ($options as $option) {\r\n                        $product_option_value_data = array();\r\n                        foreach ($option[\'product_option_value\'] as $option_value) {\r\n                            if (!$option_value[\'subtract\'] || ($option_value[\'quantity\'] > 0)) {\r\n                                $p_image = $this->model_extension_module_so_color_swatches_pro->getProductImages($result[\'product_id\'], $option_value[\'option_value_id\']);\r\n                                if (isset($p_image[\'image\']) && $p_image[\'image\']) {\r\n                                    $pimage = $this->model_tool_image->resize($p_image[\'image\'], $setting[\'width\'], $setting[\'height\']);\r\n                                } else {\r\n                                    $pimage = \'\';\r\n                                }\r\n                                if (isset($p_image[\'product_image_id\']) && $p_image[\'product_image_id\']) {\r\n                                    $product_image_id = $p_image[\'product_image_id\'];\r\n                                }\r\n                                else {\r\n                                    $product_image_id = \'\';\r\n                                }\r\n                                $product_option_value_data[] = array(\r\n                                    \'product_option_value_id\' => $option_value[\'product_option_value_id\'],\r\n                                    \'option_value_id\'         => $option_value[\'option_value_id\'],\r\n                                    \'name\'                    => $option_value[\'name\'],\r\n                                    \'image\'                   => $this->model_tool_image->resize($option_value[\'image\'], $data[\'width_product_list\'], $data[\'height_product_list\']),\r\n                                    \'price\'                   => $price,\r\n                                    \'price_prefix\'            => $option_value[\'price_prefix\'],\r\n                                    \'color_image\'             => $pimage,\r\n                                    \'product_image_id\'        => $product_image_id\r\n                                );\r\n                            }\r\n                        }\r\n                        $option_data[] = array(\r\n                            \'product_option_id\'    => $option[\'product_option_id\'],\r\n                            \'product_option_value\' => $product_option_value_data,\r\n                            \'option_id\'            => $option[\'option_id\'],\r\n                            \'name\'                 => $option[\'name\'],\r\n                            \'type\'                 => $option[\'type\'],\r\n                            \'value\'                => $option[\'value\'],\r\n                            \'required\'             => $option[\'required\']\r\n                        );\r\n                    }\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'][] = array]]></search>\r\n            <add position=\"after\" trim=\"true\" offset=\"1\"><![CDATA[\r\n                \'option\'      => $option_data,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/view/theme/*/template/extension/module/{featured,bestseller,latest,special}*.twig\">\r\n        <operation>\r\n            <search><![CDATA[<img src=\"{{ product.thumb }}\" alt=\"{{ product.name }}\" title=\"{{ product.name }}\" class=\"img-responsive\" />]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                <img src=\"{{ product.thumb }}\" alt=\"{{ product.name }}\" title=\"{{ product.name }}\" class=\"img-responsive\" id=\"product-image-{{ product.product_id }}\" />\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<h4><a href=\"{{ product.href }}\">{{ product.name }}</a></h4>]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                {% if product.option %}\r\n                <ul class=\"so-productlist-colorswatch\" id=\"colorswatch-{{ product.product_id }}\">\r\n                    {% for option in product.option %}\r\n                        {% if option.type == \'select\' %}\r\n                            {% for option_value in option.product_option_value %}\r\n                                 <li class=\"colorswatch{{option_value.product_option_value_id~option_value.option_value_id~product.product_id }}\">\r\n                                    <a href=\"javascript:void(0);\" title=\"{{ option_value.name }}\" style=\"width: {{ width_product_list }}px; height: {{ height_product_list }}px; background-image: url(\'{{ option_value.image }}\')\"></a>\r\n                                    <script type=\"text/javascript\">\r\n                                        jQuery(document).ready(function($) {\r\n                                            var $window_width = $(window).width();\r\n                                            {% if colorswatch_type == \'click\' %}\r\n                                                $(document).on(\'click\', \'.so-productlist-colorswatch li.colorswatch{{ option_value.product_option_value_id~option_value.option_value_id~product.product_id }}\', function(e) {\r\n                                                    e.preventDefault();\r\n                                                    {% if option_value.color_image %}\r\n                                                        jQuery(\'img#product-image-{{product.product_id }}\').attr(\'src\', \'{{ option_value.color_image }}\');\r\n                                                    {% endif %}\r\n                                                    \r\n                                                    $(\'.so-productlist-colorswatch li\').removeClass(\'actived\');\r\n                                                    $(this).removeClass(\'actived\').addClass(\'actived\');\r\n                                                });\r\n                                            {% else %}\r\n                                                if ($window_width > 1199) {\r\n                                                    $(\'.so-productlist-colorswatch li.colorswatch{{ option_value.product_option_value_id~option_value.option_value_id~product.product_id }}\').hover(function(e) {\r\n                                                        e.preventDefault();\r\n                                                        {% if option_value.color_image %}\r\n                                                            jQuery(\'img#product-image-{{product.product_id }}\').attr(\'src\', \'{{ option_value.color_image }}\');\r\n                                                        {% endif %}\r\n                                                        \r\n                                                        $(\'.so-productlist-colorswatch li\').removeClass(\'actived\');\r\n                                                        $(this).removeClass(\'actived\').addClass(\'actived\');\r\n                                                    });\r\n                                                }\r\n                                                else {\r\n                                                    $(document).on(\'click\', \'.so-productlist-colorswatch li.colorswatch{{ option_value.product_option_value_id~option_value.option_value_id~product.product_id }}\', function(e) {\r\n                                                        e.preventDefault();\r\n                                                        {% if option_value.color_image %}\r\n                                                            jQuery(\'img#product-image-{{product.product_id }}\').attr(\'src\', \'{{ option_value.color_image }}\');\r\n                                                        {% endif %}\r\n                                                        \r\n                                                        $(\'.so-productlist-colorswatch li\').removeClass(\'actived\');\r\n                                                        $(this).removeClass(\'actived\').addClass(\'actived\');\r\n                                                    });\r\n                                                }\r\n                                            {% endif %}\r\n                                        })\r\n                                    </script>\r\n                                </li>\r\n                            {% endfor %}\r\n                        {% endif %}\r\n                    {% endfor %}\r\n                </ul>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    \r\n</modification>',1,'2017-09-21 16:00:53','2020-10-30 14:53:56'),(10,38,'So Countdown Popup','So-countdown-popup','OpenCartWorks','1.1.0','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n    <name>So Countdown Popup</name>\n    <code>So-countdown-popup</code>\n    <version>1.1.0</version>\n    <author>OpenCartWorks</author>\n    <link>http://www.opencartworks.com/</link>\n    \n    <file path=\"catalog/controller/common/footer.php\">\n        <operation error=\"log\">\n            <search ><![CDATA[$data[\'scripts\'] = $this->document->getScripts(\'footer\');]]></search>\n            <add position=\"before\"><![CDATA[\n                $data[\'so_countdown\'] = $this->load->controller(\'extension/module/so_countdown\');\n            ]]></add>\n        </operation>\n    </file>\n    \n    <file path=\"catalog/view/theme/*/template/common/footer.twig\">\n        <operation error=\"log\">\n            <search ><![CDATA[</footer>]]></search>\n            <add position=\"after\"><![CDATA[\n                {{ so_countdown }}\n            ]]></add>\n        </operation>\n    </file>\n</modification>',1,'2017-10-06 14:32:21','2017-10-06 14:32:21'),(11,0,'Bug Fixing OC-3.x','ocmod-bugfix','OpencartWorks','3.0.0','http://www.OpencartWorks.com','<?xml version=\"1.0\" encoding=\"utf-8\"?> \n<modification> \n <name><![CDATA[Bug Fixing OC-3.x]]></name> \n <code>ocmod-bugfix</code> \n <version><![CDATA[3.0.0]]></version> \n <author><![CDATA[OpencartWorks]]></author> \n <link>http://www.OpencartWorks.com</link> \n \n \n<!--========admin/controller/common=============--> \n<file path=\"admin/controller/design/theme.php\"> \n	<operation > \n		 <search><![CDATA[if ($theme == \'theme_default\')]]></search> \n		 <add position=\"replace\"><![CDATA[ if ($theme == \'default\')]]></add> \n	</operation> \n	<operation > \n		 <search><![CDATA[{default,\' . $theme . \'}]]></search> \n		 <add position=\"replace\"><![CDATA[{\' . $theme . \'}]]></add> \n	</operation> \n</file> \n <!--========Catalog/controller/common=============--> \n <file path=\"catalog/controller/information/contact.php\"> \n	 <operation > \n	 <search><![CDATA[$this->load->language(\'information/contact\')]]></search> \n	 <add position=\"after\"><![CDATA[ \n	 $data[\'text_message\'] = $this->language->get(\'text_success\'); \n	 ]]></add> \n	 </operation> \n </file> \n \n <file path=\"catalog/language/*/common/cart.php\"> \n	 <operation > \n	 <search><![CDATA[$_[\'text_empty\']]]></search> \n	 <add position=\"replace\"><![CDATA[ $_[\'text_empty_cart\'] ]]></add> \n	 </operation> \n </file> \n \n <file path=\"catalog/view/theme/*/template/common/cart.twig\"> \n	 <operation > \n	 <search><![CDATA[text_empty]]></search> \n	 <add position=\"replace\"><![CDATA[ text_empty_cart ]]></add> \n	 </operation> \n </file> \n \n</modification> \n  ',1,'2017-10-25 10:35:01','2017-10-25 10:35:01'),(12,0,'So Product Feature','ocmod-productoption','OpencartWorks','1.0.0','http://www.OpencartWorks.com','<?xml version=\"1.0\" encoding=\"utf-8\"?> \r\n<modification> \r\n <name><![CDATA[So Product Feature]]></name> \r\n <code>ocmod-productoption</code> \r\n <version><![CDATA[1.0.0]]></version> \r\n <author><![CDATA[OpencartWorks]]></author> \r\n <link>http://www.OpencartWorks.com</link> \r\n \r\n<!--========Catalog/controller/product=============--> \r\n<file path=\"admin/language/*/catalog/product.php\">\r\n	<operation>\r\n		 <search><![CDATA[// Entry]]></search>\r\n		<add position=\"after\"><![CDATA[\r\n			// Backend Product Options\r\n			$_[\'tab_feature\']                     = \'SO Feature <span class=\"label label-primary\">News</span>\';\r\n			$_[\'entry_video_link\']                = \'Video youtube link\';\r\n			$_[\'entry_custom_tab_title\']          = \'Title custom tab \';\r\n			$_[\'entry_description_custom_tab\']          = \'Description custom tab \';\r\n\r\n		]]></add>\r\n	</operation>\r\n</file>\r\n <file path=\"admin/model/catalog/product.php\">\r\n	<operation>\r\n		<search><![CDATA[$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_description SET product_id = \'\" . (int)$product_id . \"\', language_id = \'\" . (int)$language_id . \"\', name = \'\" . $this->db->escape($value[\'name\']) . \"\', description = \'\" . $this->db->escape($value[\'description\']) . \"\', tag = \'\" . $this->db->escape($value[\'tag\']) . \"\', meta_title = \'\" . $this->db->escape($value[\'meta_title\']) . \"\', meta_description = \'\" . $this->db->escape($value[\'meta_description\']) . \"\', meta_keyword = \'\" . $this->db->escape($value[\'meta_keyword\']) . \"\'\");]]></search>\r\n		<add position=\"replace\"><![CDATA[\r\n			if ($this->checkProductOptionColumnExist()) {\r\n				$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_description SET product_id = \'\" . (int)$product_id . \"\', language_id = \'\" . (int)$language_id . \"\', name = \'\" . $this->db->escape($value[\'name\']) . \"\', description = \'\" . $this->db->escape($value[\'description\']) . \"\', tag = \'\" . $this->db->escape($value[\'tag\']) . \"\', meta_title = \'\" . $this->db->escape($value[\'meta_title\']) . \"\', meta_description = \'\" . $this->db->escape($value[\'meta_description\']) . \"\', meta_keyword = \'\" . $this->db->escape($value[\'meta_keyword\']) . \"\', video = \'\" . $this->db->escape($value[\'video\']) . \"\', tab_title = \'\" . $this->db->escape($value[\'tab_title\']) . \"\', html_product_tab = \'\" . $this->db->escape($value[\'html_product_tab\']) .  \"\'\");\r\n			}\r\n			else {\r\n				$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"product_description SET product_id = \'\" . (int)$product_id . \"\', language_id = \'\" . (int)$language_id . \"\', name = \'\" . $this->db->escape($value[\'name\']) . \"\', description = \'\" . $this->db->escape($value[\'description\']) . \"\', tag = \'\" . $this->db->escape($value[\'tag\']) . \"\', meta_title = \'\" . $this->db->escape($value[\'meta_title\']) . \"\', meta_description = \'\" . $this->db->escape($value[\'meta_description\']) . \"\', meta_keyword = \'\" . $this->db->escape($value[\'meta_keyword\']) . \"\'\");\r\n			}\r\n		]]></add>\r\n	</operation>\r\n	<operation>\r\n		<search><![CDATA[public function getTotalProductsByTaxClassId($tax_class_id) {]]></search>\r\n		<add position=\"before\"><![CDATA[\r\n			public function checkProductOptionColumnExist() {\r\n				$sql = \"SHOW COLUMNS FROM \" .DB_PREFIX. \"product_description LIKE \'video\'\";\r\n				$query = $this->db->query($sql);\r\n				return count($query->rows)>0 ? true : false;\r\n			}\r\n		]]></add>\r\n	</operation>\r\n	<operation>\r\n		<search><![CDATA[$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"product_description WHERE product_id = \'\" . (int)$product_id . \"\'\");]]></search>\r\n		<add position=\"after\" offset=\"2\"><![CDATA[\r\n			$product_video = array();\r\n			$product_tabtitle = array();\r\n			$product_tabproduct = array();\r\n			if(isset($result[\'video\']))$product_video = $result[\'video\'];\r\n			if(isset($result[\'tab_title\']))$product_tabtitle = $result[\'tab_title\'];\r\n			if(isset($result[\'html_product_tab\']))$product_tabproduct = $result[\'html_product_tab\'];\r\n						 \r\n		]]></add>\r\n	</operation>\r\n	<operation>\r\n		<search><![CDATA[\'tag\'              => $result[\'tag\']]]></search>\r\n		<add position=\"before\" offset=\"2\"><![CDATA[\r\n			\'video\'               => $product_video,\r\n			\'tab_title\'          => $product_tabtitle,\r\n			\'html_product_tab\'    => $product_tabproduct,             \r\n		]]></add>\r\n	</operation>\r\n	\r\n	\r\n</file>\r\n\r\n<file path=\"admin/controller/catalog/product.php\">\r\n	<operation>\r\n		<search><![CDATA[$data[\'products\'][] = array]]></search>\r\n		<add position=\"before\" ><![CDATA[\r\n		$product_video = array();\r\n		$product_tabtitle = array();\r\n		if(isset($result[\'video\'])){$product_video = $result[\'video\'];}\r\n		if(isset($result[\'tab_title\'])){$product_tabtitle = $result[\'tab_title\'];}\r\n		]]></add>\r\n	</operation>\r\n	<operation>\r\n		<search><![CDATA[$data[\'products\'][] = array]]></search>\r\n		<add position=\"after\" offset=\"2\"><![CDATA[\'video\'               => $product_video,\r\n			\'tab_title\'          => $product_tabtitle,]]></add>\r\n	</operation>\r\n	<operation>\r\n            <search><![CDATA[$data[\'layouts\'] = $this->model_design_layout->getLayouts();]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                $checkProductOptionColumn = \"SHOW COLUMNS FROM \" .DB_PREFIX. \"product_description LIKE \'video\'\";\r\n				$querycheckProductOption = $this->db->query($checkProductOptionColumn);\r\n				$data[\'checkProductOption\']= !empty($querycheckProductOption->rows) ? true : false;]]></add>\r\n    </operation>\r\n</file> \r\n<file path=\"admin/view/template/catalog/product_list.twig\">\r\n	<operation>\r\n		<search><![CDATA[<td class=\"text-left\">{{ product.name }}</td>]]></search>\r\n		<add position=\"replace\"><![CDATA[\r\n			<td class=\"text-left\">{{ product.name }} {% if product.video or product.tab_title %}<span class=\"label label-primary\">SO Feature</span>{% endif %}</td>\r\n		]]>\r\n		</add>\r\n	</operation>\r\n</file> \r\n<file path=\"admin/view/template/catalog/product_form.twig\">\r\n	<operation>\r\n		<search><![CDATA[<li class=\"active\"><a href=\"#tab-general\" data-toggle=\"tab\">{{ tab_general }}</a></li>]]></search>\r\n		<add position=\"after\"><![CDATA[{% if checkProductOption %}<li><a href=\"#tab-soproduct\" data-toggle=\"tab\">{{ tab_feature }}</a></li>{% endif %}]]>\r\n		</add>\r\n	</operation>\r\n	<operation>\r\n		<search><![CDATA[ <div class=\"tab-pane\" id=\"tab-data\">]]></search>\r\n		<add position=\"before\"><![CDATA[\r\n			{% if checkProductOption %}\r\n			 <div class=\"tab-pane\" id=\"tab-soproduct\">\r\n              <ul class=\"nav nav-tabs\" id=\"solanguage\">\r\n                {% for language in languages %}\r\n                <li><a href=\"#solanguage{{ language.language_id }}\" data-toggle=\"tab\"><img src=\"language/{{ language.code }}/{{ language.code }}.png\" title=\"{{ language.name }}\" /> {{ language.name }}</a></li>\r\n                {% endfor %}\r\n              </ul>\r\n              <div class=\"tab-content\">\r\n                {% for language in languages %}\r\n                <div class=\"tab-pane\" id=\"solanguage{{ language.language_id }}\">\r\n                    <div class=\"form-group \">\r\n                        <label class=\"col-sm-2 control-label\" for=\"input-video{{ language.language_id }}\">\r\n                            <strong style=\"color:red\">NEW! </strong>\r\n                            <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"Enter full video thumbnail link on Product Page\"> {{entry_video_link}} </span>\r\n                            <div style=\"font-weight:normal;\">\r\n                                (e.g. https://www.youtube.com/watch?v=Wdtw_A5FDGs)\r\n                            </div>\r\n                        </label>\r\n                        <div class=\"col-sm-10\">\r\n\r\n                          <input type=\"text\" name=\"product_description[{{ language.language_id }}][video]\" value=\"{{ product_description[language.language_id] ? product_description[language.language_id].video }}\" placeholder=\"{{ entry_video_link }}\" id=\"input-video{{ language.language_id }}\" class=\"form-control\" />\r\n                         \r\n                        </div>\r\n                    </div>\r\n\r\n                    <div class=\"form-group\">\r\n                        <label class=\"col-sm-2 control-label\" >\r\n                            <strong style=\"color:red\">NEW! </strong>\r\n                            <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"Enter title for custom tab on Product Page\"> {{entry_custom_tab_title}} </span>\r\n                        </label>\r\n\r\n                        <div class=\"col-sm-10\">\r\n                          <input type=\"text\" name=\"product_description[{{ language.language_id }}][tab_title]\" value=\"{{ product_description[language.language_id] ? product_description[language.language_id].tab_title }}\" placeholder=\"{{ entry_custom_tab_title }}\" id=\"input-tab-title{{ language.language_id }}\" class=\"form-control\" />\r\n                         \r\n                        </div>\r\n                    </div>\r\n\r\n                    <div class=\"form-group\">\r\n                        <label class=\"col-sm-2 control-label\" >\r\n                            <strong style=\"color:red\">NEW! </strong>\r\n                            <span data-toggle=\"tooltip\" title=\"\" data-original-title=\"Enter any html content for custom tab on Product Page\">\r\n                               {{ entry_description_custom_tab }}</span>\r\n                        </label>\r\n\r\n                        <div class=\"col-sm-10\">\r\n                          <textarea name=\"product_description[{{ language.language_id }}][html_product_tab]\" placeholder=\"{{ entry_description }}\" id=\"input-html_product_tab{{ language.language_id }}\" data-toggle=\"summernote\" data-lang=\"{{ summernote }}\" class=\"form-control\">{{ product_description[language.language_id] ? product_description[language.language_id].html_product_tab }}</textarea>\r\n                        </div>\r\n                    </div>\r\n                  \r\n             \r\n                </div>\r\n                {% endfor %}\r\n                </div>\r\n            </div>\r\n			<script type=\"text/javascript\"><!--\r\n			$(\'#tab-soproduct .nav-tabs > li:first\').tab(\'show\');\r\n			$(\'#tab-soproduct .tab-content > .tab-pane:first\').addClass(\'active\');\r\n			--> \r\n			</script> \r\n			{% endif %}\r\n		]]>\r\n		</add>\r\n	</operation>\r\n</file> \r\n\r\n <file path=\"catalog/controller/product/product.php\"> \r\n <operation> \r\n <search ><![CDATA[$data[\'options\'] = array();]]></search> \r\n	 <add position=\"before\"><![CDATA[ \r\n	$productoption_info = $this->model_extension_soconfig_general->getProduct($product_id);\r\n	$data[\'product_video\'] = array();\r\n	$data[\'product_tabtitle\'] = array();\r\n	$data[\'product_tabcontent\'] = array();\r\n	if(isset($productoption_info[\'video\'])) $data[\'product_video\'] = $productoption_info[\'video\'];\r\n	if(isset($productoption_info[\'tab_title\'])) $data[\'product_tabtitle\'] = $productoption_info[\'tab_title\'];\r\n	if(isset($productoption_info[\'html_product_tab\'])) $data[\'product_tabcontent\'] = html_entity_decode($productoption_info[\'html_product_tab\'], ENT_QUOTES, \'UTF-8\');\r\n	 ]]></add> \r\n </operation> \r\n </file> \r\n</modification> ',1,'2018-01-03 15:01:14','2018-01-03 15:01:14'),(13,44,'Modification Manager','modification_manager','Opencart-templates','3.0.4','http://www.opencart-templates.co.uk/modification-manager','<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<modification>\n	<name>Modification Manager</name>\n	<code>modification_manager</code>\n	<version>3.0.4</version>\n	<author>Opencart-templates</author>\n	<link>http://www.opencart-templates.co.uk/modification-manager</link>\n\n	<file path=\"admin/language/en-gb/marketplace/modification.php\">\n		<operation>\n			<search index=\"0\"><![CDATA[<?php]]></search>\n			<add position=\"after\"><![CDATA[\n$_[\'tab_error\'] = \'Error\';\n$_[\'tab_files\'] = \'Files\';\n\n$_[\'text_add\'] = \'Add Modification\';\n$_[\'text_edit\'] = \'Edit Modification: %s\';\n\n$_[\'text_enabled\'] = \'Enabled\';\n$_[\'text_disabled\'] = \'Disabled\';\n\n$_[\'entry_author\'] = \'Author\';\n$_[\'entry_name\'] = \'Name\';\n$_[\'entry_xml\'] = \'XML\';\n\n$_[\'button_filter\'] = \'Filter\';\n$_[\'button_reset\'] = \'Reset\';\n$_[\'button_download\'] = \'Download\';\n\n$_[\'column_date_modified\'] = \'Last Modified\';\n\n$_[\'error_warning\'] = \'There has been an error. Please check your data and try again\';\n$_[\'error_required\'] = \'This field is required\';\n$_[\'error_name\'] = \'Missing name tag\';\n$_[\'error_code\'] = \'Missing code tag\';\n$_[\'error_exists\'] = \'Modification \\\'%s\\\' is already using the same code: %s!\';]]></add>\n		</operation>\n	</file>\n\n	<file path=\"admin/controller/marketplace/modification.php\">\n	    <operation>\n			<search index=\"0\"><![CDATA[public function index() {]]></search>\n			<add position=\"after\"><![CDATA[      	$this->load->model(\'extension/module/modification_manager\');\n\n		$this->model_extension_module_modification_manager->install();\n]]></add>\n		</operation>\n	    <operation>\n			<search><![CDATA[$this->model_setting_modification]]></search>\n			<add position=\"before\"><![CDATA[$this->load->model(\'extension/module/modification_manager\');\n]]></add>\n		</operation>\n	    <operation>\n			<search><![CDATA[$this->model_setting_modification->]]></search>\n			<add position=\"replace\"><![CDATA[$this->model_extension_module_modification_manager->]]></add>\n		</operation>\n	    <operation>\n			<search index=\"0\"><![CDATA[$sort = \'name\';]]></search>\n			<add position=\"replace\"><![CDATA[$sort = \'date_modified\';]]></add>\n		</operation>\n	    <operation>\n			<search index=\"0\"><![CDATA[$order = \'ASC\';]]></search>\n			<add position=\"replace\"><![CDATA[$order = \'DESC\';]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$handle = fopen(DIR_LOGS . \'ocmod.log\', \'w+\');]]></search>\n			<add position=\"before\"><![CDATA[      	fclose($handle);\n			\n					$handle = fopen(DIR_LOGS . \'ocmod_error.log\', \'w+\');]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$maintenance = $this->config->get(\'config_maintenance\');]]></search>\n			<add position=\"after\"><![CDATA[\n			// Clear logs on refresh\n			$handle = fopen(DIR_LOGS . \'ocmod.log\', \'w+\');\n			fclose($handle);\n\n			$handle = fopen(DIR_LOGS . \'ocmod_error.log\', \'w+\');\n			fclose($handle);\n]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$data[\'breadcrumbs\'] = array();]]></search>\n			<add position=\"before\"><![CDATA[      	$this->load->model(\'extension/module/modification_manager\');\n\n		if (isset($this->request->get[\'filter_name\'])) {\n			$filter_name = $this->request->get[\'filter_name\'];\n		} else {\n			$filter_name = null;\n		}\n\n      	if (isset($this->request->get[\'filter_xml\'])) {\n			$filter_xml = $this->request->get[\'filter_xml\'];\n		} else {\n			$filter_xml = null;\n		}\n\n		if (isset($this->request->get[\'filter_author\'])) {\n			$filter_author = $this->request->get[\'filter_author\'];\n		} else {\n			$filter_author = null;\n		}\n\n		$url = $this->getListUrlParams();\n\n		$data[\'add\'] = $this->url->link(\'marketplace/modification/add\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true);\n		$data[\'clear_log\'] = $this->url->link(\'marketplace/modification/clearlog\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true);\n		$data[\'filter_action\'] = $this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'], true);\n		$data[\'reset_url\'] = $this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'], true);\n\n		$data[\'tab_files\'] = $this->language->get(\'tab_files\');\n		$data[\'tab_error\'] = $this->language->get(\'tab_error\');]]></add>\n		</operation>\n		\n		<operation>\n			<search index=\"0\"><![CDATA[$data[\'sort_name\'] =]]></search>\n			<add position=\"before\"><![CDATA[      	if (isset($this->request->get[\'filter_name\'])) {\n			$url .= \'&filter_name=\' . urlencode(html_entity_decode($this->request->get[\'filter_name\'], ENT_QUOTES, \'UTF-8\'));\n		}\n\n		if (isset($this->request->get[\'filter_author\'])) {\n			$url .= \'&filter_author=\' . urlencode(html_entity_decode($this->request->get[\'filter_author\'], ENT_QUOTES, \'UTF-8\'));\n		}\n\n		if (isset($this->request->get[\'filter_xml\'])) {\n			$url .= \'&filter_xml=\' . urlencode(html_entity_decode($this->request->get[\'filter_xml\'], ENT_QUOTES, \'UTF-8\'));\n		}\n\n		$data[\'sort_date_modified\'] = $this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'] . \'&sort=date_modified\' . $url, true);]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$filter_data = array(]]></search>\n			<add position=\"after\"><![CDATA[      	\'filter_name\'	  => $filter_name,\n			\'filter_author\'	  => $filter_author,\n			\'filter_xml\'	  => $filter_xml,]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$data[\'modifications\'][] = array(]]></search>\n			<add position=\"after\"><![CDATA[				\'date_modified\'      => $result[\'date_modified\'] && $result[\'date_modified\'] != \'0000-00-00 00:00:00\' ? date(date(\'Ymd\') == date(\'Ymd\', strtotime($result[\'date_modified\'])) ? \'G:i\' : $this->language->get(\'date_format_short\'), strtotime($result[\'date_modified\'])) : null,\n				\'edit\'			     => $this->url->link(\'marketplace/modification/edit\', \'user_token=\' . $this->session->data[\'user_token\'] . \'&modification_id=\' . $result[\'modification_id\'] . $url, true),\n				\'download\'			 => $this->url->link(\'marketplace/modification/download\', \'user_token=\' . $this->session->data[\'user_token\'] . \'&modification_id=\' . $result[\'modification_id\'] , true),]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$pagination = new Pagination();]]></search>\n			<add position=\"before\"><![CDATA[      	if (isset($this->request->get[\'filter_name\'])) {\n			$url .= \'&filter_name=\' . urlencode(html_entity_decode($this->request->get[\'filter_name\'], ENT_QUOTES, \'UTF-8\'));\n		}\n\n		if (isset($this->request->get[\'filter_author\'])) {\n			$url .= \'&filter_author=\' . urlencode(html_entity_decode($this->request->get[\'filter_author\'], ENT_QUOTES, \'UTF-8\'));\n		}\n\n		if (isset($this->request->get[\'filter_xml\'])) {\n			$url .= \'&filter_xml=\' . urlencode(html_entity_decode($this->request->get[\'filter_xml\'], ENT_QUOTES, \'UTF-8\'));\n		}]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$data[\'clear_log\'] =]]></search>\n			<add position=\"before\"><![CDATA[		$data[\'filter_name\'] = $filter_name;\n		$data[\'filter_author\'] = $filter_author;\n		$data[\'filter_xml\'] = $filter_xml;\n\n		$data[\'modified_files\'] = array();\n\n		$modified_files = self::modifiedFiles(DIR_MODIFICATION);\n\n		$modification_files = $this->getModificationXmlFiles();\n\n		foreach($modified_files as $modified_file) {\n			if(isset($modification_files[$modified_file])){\n				$modifications = $modification_files[$modified_file];\n			} else {\n				$modifications = array();\n			}\n\n			$data[\'modified_files\'][] = array(\n				\'file\' => $modified_file,\n				\'modifications\' => $modifications\n			);\n		}\n\n		// Error log\n		$error_file = DIR_LOGS . \'ocmod_error.log\';\n\n		if (file_exists($error_file)) {\n			$data[\'error_log\'] = htmlentities(file_get_contents($error_file, FILE_USE_INCLUDE_PATH, null));\n		} else {\n			$data[\'error_log\'] = \'\';\n		}\n		]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$this->load->view(\'marketplace/modification\']]></search>\n			<add position=\"replace\"><![CDATA[$this->load->view(\'extension/module/modification_manager/list\']]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[$this->response->redirect($this->url->link(!empty($data[\'redirect\']) ? $data[\'redirect\'] : \'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true));]]></search>\n			<ignoreif position=\"replace\"><![CDATA[if (!empty($data[\'redirect\'])) {]]></ignoreif>\n			<add position=\"replace\"><![CDATA[$url = $this->getListUrlParams();\n\n			if (!empty($data[\'redirect\'])) {\n				$redirect = $data[\'redirect\'];\n			} elseif (!empty($this->request->get[\'redirect\'])) {\n				$redirect = $this->request->get[\'redirect\'];\n			} else {\n				$redirect = \'marketplace/modification\';\n			}\n\n			$this->response->redirect($this->url->link($redirect, \'user_token=\' . $this->session->data[\'user_token\'] . $url, true));]]></add>\n		</operation>\n	    <operation>\n			<search index=\"0\"><![CDATA[if ($this->validate()) {]]></search>\n			<add position=\"after\"><![CDATA[				$error_log = array();\n\n			// Clear vqmod cache\n			$vqmod_path = substr(DIR_SYSTEM, 0, -7) . \'vqmod/\';\n\n			if (file_exists($vqmod_path)) {\n				$vqmod_cache = glob($vqmod_path.\'vqcache/vq*\');\n\n				if ($vqmod_cache) {\n					foreach ($vqmod_cache as $file) {\n						if (file_exists($file)) {\n							@unlink($file);\n						}\n					}\n				}\n\n				if (file_exists($vqmod_path.\'mods.cache\')) {\n					@unlink($vqmod_path.\'mods.cache\');\n				}\n\n				if (file_exists($vqmod_path.\'checked.cache\')) {\n					@unlink($vqmod_path.\'checked.cache\');\n				}\n			}\n]]></add>\n		</operation>\n	    <operation>\n			<search index=\"0\"><![CDATA[$log[] = \'MOD:]]></search>\n			<add position=\"after\"><![CDATA[				$error_log_mod = \'MOD: \' . $dom->getElementsByTagName(\'name\')->item(0)->textContent;\n]]></add>\n		</operation>\n	    <operation>\n			<search index=\"0\"><![CDATA[$operations = $file->getElementsByTagName(\'operation\');]]></search>\n			<add position=\"after\"><![CDATA[				\n					$file_error = $file->getAttribute(\'error\');]]></add>\n		</operation>\n	    <operation>\n			<search index=\"0\"><![CDATA[$files = glob($path, GLOB_BRACE);]]></search>\n			<add position=\"after\"><![CDATA[							if (!$files) {\n								if ($file_error != \'skip\') {\n									$error_log[] = \'----------------------------------------------------------------\';\n									$error_log[] = $error_log_mod;\n									$error_log[] = \'MISSING FILE!\';\n									$error_log[] = $path;									\n								}\n							}]]></add>\n		</operation>\n	    <operation>\n			<search index=\"0\"><![CDATA[if (!$status) {]]></search>\n			<add position=\"after\"><![CDATA[											if ($error != \'skip\') {\n												$error_log[] = \"\\n\";\n												$error_log[] = $error_log_mod;\n												$error_log[] = \'NOT FOUND!\';\n												$error_log[] = \'CODE: \' . $search;\n												$error_log[] = \'FILE: \' . $key;\n											}]]></add>\n		</operation>\n	    <operation>\n			<search index=\"0\"><![CDATA[$ocmod->write(implode(\"\\n\", $log));]]></search>\n			<add position=\"after\"><![CDATA[\n			if ($error_log) {\n				$ocmod = new Log(\'ocmod_error.log\');\n				$ocmod->write(implode(\"\\n\", $error_log));\n			}]]></add>\n		</operation>\n		<operation>\n			<search index=\"0\"><![CDATA[protected function validate(]]></search>\n			<add position=\"before\"><![CDATA[\n\npublic function add() {\n		$this->load->language(\'marketplace/modification\');\n\n		$this->load->model(\'extension/module/modification_manager\');\n\n		if (($this->request->server[\'REQUEST_METHOD\'] == \'POST\') && $this->validateForm()) {\n			$xml = html_entity_decode($this->request->post[\'xml\'], ENT_QUOTES, \'UTF-8\');\n\n			$dom = new DOMDocument(\'1.0\', \'UTF-8\');\n			$dom->preserveWhiteSpace = false;\n			$dom->loadXml($xml);\n\n			$data = array(\n				\'version\' => \'\',\n				\'author\' => \'\',\n				\'link\' => \'\',\n				\'status\' => 1\n			);\n\n			$data[\'xml\'] = $xml;\n\n			$data[\'name\'] = $dom->getElementsByTagName(\'name\')->item(0)->textContent;\n\n			$data[\'code\'] = $dom->getElementsByTagName(\'code\')->item(0)->textContent;\n\n			if ($dom->getElementsByTagName(\'version\')->length) {\n				$data[\'version\'] = $dom->getElementsByTagName(\'version\')->item(0)->textContent;\n			}\n\n			if ($dom->getElementsByTagName(\'author\')->length) {\n				$data[\'author\'] = $dom->getElementsByTagName(\'author\')->item(0)->textContent;\n			}\n\n			$this->model_extension_module_modification_manager->addModification($data);\n\n			$modification_id = $this->db->getLastId();\n\n			$this->session->data[\'success\'] = $this->language->get(\'text_success\');\n\n			$this->response->redirect($this->url->link(\'marketplace/modification/edit\', \'user_token=\' . $this->session->data[\'user_token\'] . $this->getListUrlParams(array(\'modification_id\' => $modification_id)), true));\n		}\n\n		$this->getForm();\n	}\n\n	public function edit() {\n		$this->load->language(\'marketplace/modification\');\n\n		$this->load->model(\'extension/module/modification_manager\');\n		\n		if (($this->request->server[\'REQUEST_METHOD\'] == \'POST\') && !empty($this->request->get[\'modification_id\']) && $this->validateForm()) {\n			$modification_id = $this->request->get[\'modification_id\'];\n\n			$xml = html_entity_decode($this->request->post[\'xml\'], ENT_QUOTES, \'UTF-8\');\n\n			$dom = new DOMDocument(\'1.0\', \'UTF-8\');\n			$dom->preserveWhiteSpace = false;\n			$dom->loadXml($xml);\n\n			$data = array();\n\n			$data[\'xml\'] = $xml;\n\n			$data[\'name\'] = $dom->getElementsByTagName(\'name\')->item(0)->textContent;\n\n			$data[\'code\'] = $dom->getElementsByTagName(\'code\')->item(0)->textContent;\n\n			if ($dom->getElementsByTagName(\'version\')->length) {\n				$data[\'version\'] = $dom->getElementsByTagName(\'version\')->item(0)->textContent;\n			} else {\n				$data[\'version\'] = \'\';\n			}\n\n			if ($dom->getElementsByTagName(\'author\')->length) {\n				$data[\'author\'] = $dom->getElementsByTagName(\'author\')->item(0)->textContent;\n			} else {\n				$data[\'author\'] = \'\';\n			}\n\n			if ($dom->getElementsByTagName(\'link\')->length) {\n				$data[\'link\'] = $dom->getElementsByTagName(\'link\')->item(0)->textContent;\n			} else {\n				$data[\'link\'] = \'\';\n			}\n\n			$this->model_extension_module_modification_manager->editModification($modification_id, $data);\n\n			$url = $this->getListUrlParams(array(\'modification_id\' => $modification_id));\n\n			if (isset($this->request->get[\'refresh\'])) {\n				$this->response->redirect($this->url->link(\'marketplace/modification/refresh\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true));\n			}\n\n			if ($this->db->countAffected()) {\n				$this->session->data[\'success\'] = $this->language->get(\'text_success\');\n\n				$this->response->redirect($this->url->link(\'marketplace/modification/edit\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true));\n			}\n		}\n\n		$this->getForm();\n	}\n	\n	public function download() {\n		\n        if (!$this->user->hasPermission(\'modify\', \'marketplace/modification\')) {\n            $this->response->redirect($this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'], true));\n        }\n\n        if (isset($this->request->get[\'modification_id\'])) {\n            $modification_id = $this->request->get[\'modification_id\'];\n        } else {\n            $modification_id = 0;\n        }\n		\n		$this->load->model(\'extension/module/modification_manager\');\n        $modification = $this->model_extension_module_modification_manager->getModification($modification_id);\n\n        if ($modification) {\n            $filename = $modification[\'code\'] . \'.ocmod.xml\';\n            $file = $modification[\'xml\'];\n\n            ob_start();\n            echo $file;\n            $download = ob_get_contents();\n            $size = ob_get_length();\n            ob_end_clean();\n            \n            if (!headers_sent()) {\n                if (!empty($modification[\'xml\'])) {\n                    header(\'Content-Type: application/octet-stream\');\n                    header(\'Content-Disposition: attachment; filename=\"\' . $filename . \'\"\');\n                    header(\'Content-Transfer-Encoding: binary\');\n                    header(\'Expires: 0\');\n                    header(\'Cache-Control: must-revalidate, post-check=0, pre-check=0\');\n                    header(\'Pragma: public\');\n                    header(\'Content-Length: \' . $size);\n\n                    if (ob_get_level()) {\n                        ob_end_clean();\n                    }\n\n                    echo $download;\n\n                    exit();\n                } else {\n                    exit($this->language->get(\'error_file\'));\n                }\n            } else {\n                exit($this->language->get(\'error_headers\'));\n            }\n        } else {\n			$this->response->redirect($this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'] . $url, true));\n        }\n    }\n	\n	public function getForm() {\n		$data[\'heading_title\'] = $this->language->get(\'heading_title\');\n\n		$data[\'text_enabled\'] = $this->language->get(\'text_enabled\');\n		$data[\'text_disabled\'] = $this->language->get(\'text_disabled\');\n\n		$data[\'button_save\'] = $this->language->get(\'button_save\');\n		$data[\'button_download\'] = $this->language->get(\'button_download\');\n		$data[\'button_refresh\'] = $this->language->get(\'button_refresh\');\n		$data[\'button_cancel\'] = $this->language->get(\'button_cancel\');\n\n		if (isset($this->error[\'warning\'])) {\n			$data[\'error_warning\'] = $this->error[\'warning\'];\n		} elseif (!empty($this->error)) {\n			$data[\'error_warning\'] = $this->language->get(\'error_warning\');\n		} else {\n			$data[\'error_warning\'] = \'\';\n		}\n\n		if (isset($this->session->data[\'success\'])) {\n			$data[\'success\'] = $this->session->data[\'success\'];\n\n			unset($this->session->data[\'success\']);\n		} else {\n			$data[\'success\'] = false;\n		}\n\n		if (isset($this->error[\'xml\'])) {\n			$data[\'error_xml\'] = $this->error[\'xml\'];\n		}\n\n		$data[\'breadcrumbs\'] = array();\n\n		$data[\'breadcrumbs\'][] = array(\n			\'text\' => $this->language->get(\'text_home\'),\n			\'href\' => $this->url->link(\'common/dashboard\', \'user_token=\' . $this->session->data[\'user_token\'], true)\n		);\n\n		$data[\'breadcrumbs\'][] = array(\n			\'text\' => $this->language->get(\'heading_title\'),\n			\'href\' => $this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'] . $this->getListUrlParams(), true)\n		);\n\n		if (isset($this->request->get[\'modification_id\'])) {\n			$this->load->model(\'extension/module/modification_manager\');\n\n			$modification_info = $this->model_extension_module_modification_manager->getModification($this->request->get[\'modification_id\']);\n			if (!$modification_info) exit;\n\n			$data[\'text_form\'] = sprintf($this->language->get(\'text_edit\'), $modification_info[\'name\']);\n\n			$data[\'action\'] = $this->url->link(\'marketplace/modification/edit\', \'&modification_id=\' . $modification_info[\'modification_id\'] . \'&user_token=\' . $this->session->data[\'user_token\'], true);\n\n			$data[\'refresh\'] = $this->url->link(\'marketplace/modification/edit\', \'&modification_id=\' . $modification_info[\'modification_id\'] . \'&refresh=1&user_token=\' . $this->session->data[\'user_token\'], true);\n\n			$this->document->setTitle($modification_info[\'name\'] . \' ? \' . $data[\'heading_title\']);\n		} else {\n			$data[\'text_form\'] = $this->language->get(\'text_add\');\n\n			$data[\'refresh\'] = false;\n\n			$data[\'action\'] = $this->url->link(\'marketplace/modification/add\', \'user_token=\' . $this->session->data[\'user_token\'], true);\n\n			$this->document->setTitle($data[\'heading_title\']);\n		}\n\n		$data[\'cancel\'] = $this->url->link(\'marketplace/modification\', \'user_token=\' . $this->session->data[\'user_token\'] . $this->getListUrlParams(), true);\n\n		$data[\'modification\'] = array();\n\n		if (!empty($modification_info)) {\n			$data[\'modification\'][\'status\'] = $modification_info[\'status\'];\n		} else {\n			$data[\'modification\'][\'status\'] = 0;\n		}\n\n		if (isset($this->request->post[\'xml\'])) {\n			$data[\'modification\'][\'xml\'] = html_entity_decode($this->request->post[\'xml\'], ENT_QUOTES, \'UTF-8\');\n		} elseif (!empty($modification_info)) {\n			$data[\'modification\'][\'xml\'] = $modification_info[\'xml\'];\n		} else {\n			$data[\'modification\'][\'xml\'] = \'\';\n		}\n\n		$this->document->addStyle(\'view/javascript/codemirror/lib/codemirror.css\');\n		$this->document->addScript(\'view/javascript/codemirror/lib/codemirror.js\');\n		$this->document->addScript(\'view/javascript/codemirror/mode/xml/xml.js\');\n\n		$data[\'header\'] = $this->load->controller(\'common/header\');\n		$data[\'column_left\'] = $this->load->controller(\'common/column_left\');\n		$data[\'footer\'] = $this->load->controller(\'common/footer\');\n\n		$this->response->setOutput($this->load->view(\'extension/module/modification_manager/form\', $data));\n	}\n\n	private function validateForm() {\n		if (!$this->user->hasPermission(\'modify\', \'marketplace/modification\')) {\n			$this->error[\'warning\'] = $this->language->get(\'error_permission\');\n		}\n\n		$error = false;\n\n		// Required\n		if (empty($this->request->post[\'xml\'])) {\n			$error = $this->language->get(\'error_required\');\n		}\n\n		// 2. Validate XML\n		if (!$error) {\n			libxml_use_internal_errors(true);\n\n			$dom = new DOMDocument(\'1.0\', \'UTF-8\');\n\n			if(!$dom->loadXml(html_entity_decode($this->request->post[\'xml\'], ENT_QUOTES, \'UTF-8\'))){\n\n			    foreach (libxml_get_errors() as $error) {\n			        $msg = \'\';\n\n			        switch ($error->level) {\n			            case LIBXML_ERR_WARNING :\n			                $msg .= \"Warning $error->code: \";\n			                break;\n			            case LIBXML_ERR_ERROR :\n			                $msg .= \"Error $error->code: \";\n			                break;\n			            case LIBXML_ERR_FATAL :\n			                $msg .= \"Fatal Error $error->code: \";\n			                break;\n			        }\n\n			        $msg .= trim ( $error->message ) . \"\\nLine: $error->line\";\n\n			        $error = $msg;\n			    }\n\n			    libxml_clear_errors();\n			}\n\n			libxml_use_internal_errors(false);\n		}\n\n		// 3. Required tags\n		if (!$error && (!$dom->getElementsByTagName(\'name\') || $dom->getElementsByTagName(\'name\')->length == 0 || $dom->getElementsByTagName(\'name\')->item(0)->textContent == \'\')) {\n			$error = $this->language->get(\'error_name\');\n		}\n\n		if (!$error && (!$dom->getElementsByTagName(\'code\') || $dom->getElementsByTagName(\'code\')->length == 0 || $dom->getElementsByTagName(\'code\')->item(0)->textContent == \'\')) {\n			$error = $this->language->get(\'error_code\');\n		}\n\n		// 4. Check code isn\'t duplicate\n		if (!$error) {\n			$code = $dom->getElementsByTagName(\'code\')->item(0)->textContent;\n\n			$this->load->model(\'extension/module/modification_manager\');\n			\n			$modification_info = $this->model_extension_module_modification_manager->getModificationByCode($code);\n\n			if ($modification_info && (!isset($this->request->get[\'modification_id\']) || $modification_info[\'modification_id\'] != $this->request->get[\'modification_id\'])) {\n				$error = sprintf($this->language->get(\'error_exists\'), $modification_info[\'name\'], $modification_info[\'code\']);\n			}\n		}\n\n		if ($error) {\n			$this->error[\'xml\'] = $error;\n		}\n\n		return !$this->error;\n	}\n\n	static function modifiedFiles($dir, $dirLen = 0) {\n		$tree = glob(rtrim($dir, \'/\') . \'/*\');\n		if (!$dirLen) {\n			$dirLen = strlen($dir);\n		}\n		$files = array();\n\n	    if (is_array($tree)) {\n	        foreach($tree as $file) {\n	        	if ($file == $dir . \'index.html\') {\n					continue;\n				} elseif (is_file($file)) {\n	                $files[] = substr($file, $dirLen);\n	            } elseif (is_dir($file)) {\n	                $files = array_merge($files, self::modifiedFiles($file, $dirLen));\n	            }\n	        }\n	    }\n\n	    return $files;\n	}\n\n	protected function getListUrlParams(array $params = array()) {\n		if (isset($params[\'sort\'])) {\n			$params[\'sort\'] = $params[\'sort\'];\n		} elseif (isset($this->request->get[\'sort\'])) {\n			$params[\'sort\'] = $this->request->get[\'sort\'];\n		}\n\n		if (isset($params[\'order\'])) {\n			$params[\'order\'] = $params[\'order\'];\n		} elseif (isset($this->request->get[\'order\'])) {\n			$params[\'order\'] = $this->request->get[\'order\'];\n		}\n\n		if (isset($params[\'filter_name\'])) {\n			$params[\'filter_name\'] = urlencode(html_entity_decode($params[\'filter_name\'], ENT_QUOTES, \'UTF-8\'));\n		} elseif (isset($this->request->get[\'filter_name\'])) {\n			$params[\'filter_name\'] = urlencode(html_entity_decode($this->request->get[\'filter_name\'], ENT_QUOTES, \'UTF-8\'));\n		}\n\n		if (isset($params[\'filter_author\'])) {\n			$params[\'filter_author\'] = urlencode(html_entity_decode($params[\'filter_author\'], ENT_QUOTES, \'UTF-8\'));\n		} elseif (isset($this->request->get[\'filter_author\'])) {\n			$params[\'filter_author\'] = urlencode(html_entity_decode($this->request->get[\'filter_author\'], ENT_QUOTES, \'UTF-8\'));\n		}\n\n		if (isset($params[\'filter_xml\'])) {\n			$params[\'filter_xml\'] = urlencode(html_entity_decode($params[\'filter_xml\'], ENT_QUOTES, \'UTF-8\'));\n		} elseif (isset($this->request->get[\'filter_xml\'])) {\n			$params[\'filter_xml\'] = urlencode(html_entity_decode($this->request->get[\'filter_xml\'], ENT_QUOTES, \'UTF-8\'));\n		}\n\n		if (isset($params[\'page\'])) {\n			$params[\'page\'] = $params[\'page\'];\n		} elseif (isset($this->request->get[\'page\'])) {\n			$params[\'page\'] = $this->request->get[\'page\'];\n		}\n\n		$paramsJoined = array();\n\n		foreach($params as $param => $value) {\n			$paramsJoined[] = \"$param=$value\";\n		}\n\n		return \'&\' . implode(\'&\', $paramsJoined);\n	}\n\n	protected function getModificationXmlFiles() {\n		$return = array();\n\n		$baseLen = strlen(substr(DIR_SYSTEM, 0, -7));\n\n		$xml = array();\n\n		$xml[] = file_get_contents(DIR_SYSTEM . \'modification.xml\');\n\n		$files = glob(DIR_SYSTEM . \'*.ocmod.xml\');\n\n		if ($files) {\n			foreach ($files as $file) {\n				$xml[] = file_get_contents($file);\n			}\n		}\n\n		$results = $this->model_extension_module_modification_manager->getModifications();\n\n		foreach ($results as $result) {\n			if ($result[\'status\']) {\n				$xml[] = $result[\'xml\'];\n			}\n		}\n\n		foreach ($xml as $xml) {\n			if (empty($xml)){\n				continue;\n			}\n\n			$dom = new DOMDocument(\'1.0\', \'UTF-8\');\n			$dom->preserveWhiteSpace = false;\n			$dom->loadXml($xml);\n\n			$files = $dom->getElementsByTagName(\'modification\')->item(0)->getElementsByTagName(\'file\');\n\n			foreach ($files as $file) {\n				$operations = $file->getElementsByTagName(\'operation\');\n\n				$files = explode(\',\', $file->getAttribute(\'path\'));\n\n				foreach ($files as $file) {\n					$path = \'\';\n\n					// Get the full path of the files that are going to be used for modification\n					if (substr($file, 0, 7) == \'catalog\') {\n						$path = DIR_CATALOG . str_replace(\'../\', \'\', substr($file, 8));\n					}\n\n					if (substr($file, 0, 5) == \'admin\') {\n						$path = DIR_APPLICATION . str_replace(\'../\', \'\', substr($file, 6));\n					}\n\n					if (substr($file, 0, 6) == \'system\') {\n						$path = DIR_SYSTEM . str_replace(\'../\', \'\', substr($file, 7));\n					}\n\n					if ($path) {\n						$files = glob($path, GLOB_BRACE);\n\n						if ($files) {\n							foreach ($files as $file) {\n								$file = substr($file, $baseLen);\n\n								if (!isset($return[$file])) {\n									$return[$file] = array();\n								}\n\n								if ($dom->getElementsByTagName(\'code\')->length) {\n									$code = $dom->getElementsByTagName(\'code\')->item(0)->textContent;\n								} else {\n									continue;\n								}\n\n								if (!empty($return[$file])) {\n									foreach ($return[$file] as $return_file) {\n										if ($return_file[\'code\'] == $code) {\n											continue 2;\n										}\n									}\n								}\n\n								if ($dom->getElementsByTagName(\'name\')->length) {\n									$name = $dom->getElementsByTagName(\'name\')->item(0)->textContent;\n								} else {\n									continue;\n								}\n\n								if ($dom->getElementsByTagName(\'author\')->length) {\n									$author = $dom->getElementsByTagName(\'author\')->item(0)->textContent;\n								} else {\n									$author = \'\';\n								}\n\n								$return[$file][] = array(\n									\'code\' => $code,\n									\'name\' => $name,\n									\'author\' => $author\n								);\n							}\n						}\n					}\n				}\n			}\n		}\n\n		return $return;\n	}\n\n]]></add>\n		</operation>\n	</file>\n</modification>',1,'2018-01-03 17:29:19','2018-01-03 17:29:19'),(14,46,'So Call for Price','so-call-for-price','OpenCartWorks','1.0.1','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>So Call for Price</name>\r\n    <code>so-call-for-price</code>\r\n    <version>1.0.1</version>\r\n    <author>OpenCartWorks</author>\r\n    <link>http://www.opencartworks.com/</link>\r\n    \r\n    <file path=\"catalog/language/en-gb/en-gb.php\">\r\n        <operation>\r\n            <search><![CDATA[<?php]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                $_[\'text_price_0\']              = \'Call for Price\';\r\n                $_[\'text_form_title\']           = \'Call For Price\';\r\n                $_[\'text_name\']                 = \'Name\';\r\n                $_[\'text_email_id\']             = \'Email ID\';\r\n                $_[\'text_contact_number\']       = \'Contact Number\';\r\n                $_[\'text_inquiry_details\']      = \'Inquiry Details\';\r\n                $_[\'text_country\']              = \'Country\';\r\n                $_[\'text_submit\']               = \'Submit\';\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/language/ar-ar/ar-ar.php\">\r\n        <operation>\r\n            <search><![CDATA[<?php]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                $_[\'text_price_0\']              = \'Call for Price\';\r\n                $_[\'text_form_title\']           = \'Call For Price\';\r\n                $_[\'text_name\']                 = \'Name\';\r\n                $_[\'text_email_id\']             = \'Email ID\';\r\n                $_[\'text_contact_number\']       = \'Contact Number\';\r\n                $_[\'text_inquiry_details\']      = \'Inquiry Details\';\r\n                $_[\'text_country\']              = \'Country\';\r\n                $_[\'text_submit\']               = \'Submit\';\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n  \r\n    <file path=\"catalog/controller/extension/module/{featured,bestseller}*.php\">\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'] = array();]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if (isset($this->request->server[\'HTTPS\']) && (($this->request->server[\'HTTPS\'] == \'on\') || ($this->request->server[\'HTTPS\'] == \'1\'))) {\r\n                    $data[\'base\'] = $this->config->get(\'config_ssl\');\r\n                } else {\r\n                    $data[\'base\'] = $this->config->get(\'config_url\');\r\n                }\r\n\r\n                $this->load->model(\'setting/setting\');\r\n                $data[\'cfp_setting\'] = $this->model_setting_setting->getSetting(\'module_so_call_for_price\');\r\n				\r\n				if (!defined (\'FANCYBOX\'))\r\n					{\r\n					$this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/jquery.fancybox.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/jquery.fancybox.js\');\r\n					define( \'FANCYBOX\', 1 );\r\n				}\r\n                if (!defined (\'so_call_for_price\')){\r\n                   \r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/style.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/script.js\');\r\n                    define( \'so_call_for_price\', 1 );\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$product_info[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ((float)$product_info[\'price\']) {\r\n                    $price_0 = $product_info[\'price\'];\r\n                }\r\n                else {\r\n                    $price_0 = false;\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'price\'       => $price,]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'price_0\'       => $price_0,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/view/theme/*/template/extension/module/{featured,bestseller,latest,special}*.twig\">\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[{{ product.price }}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'0\' %}\r\n                        <a data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" href=\"javascript:;\" class=\"callforprice\" style=\"color: #ff0000; font-weight: bold;\"><i class=\"fa fa-phone\"></i> {{ text_price_0 }}</a>\r\n                    {% endif %}\r\n                {% else %}\r\n                    {{ product.price }}\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[{% if product.tax %}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if ((product.tax) and (cfp_setting.module_so_call_for_price_status) and (product.price_0 > 0)) %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<button type=\"button\" onclick=\"cart.add(\'{{ product.product_id }}\');\"><i class=\"fa fa-shopping-cart\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ button_cart }}</span></button>]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_hide_cart is defined and cfp_setting.module_so_call_for_price_hide_cart == \'0\' %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\">{{ text_price_0 }}</button>\r\n                        {% else %}\r\n                            <button type=\"button\" style=\"cursor: default; background-color: #eee; color: #ccc;\"><i class=\"fa fa-shopping-cart\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ button_cart }}</span></button>\r\n                        {% endif %}\r\n                    {% else %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\">{{ text_price_0 }}</button>\r\n                        {% endif %}\r\n                    {% endif %}\r\n                {% else %}\r\n                    <button type=\"button\" onclick=\"cart.add(\'{{ product.product_id }}\');\"><i class=\"fa fa-shopping-cart\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ button_cart }}</span></button>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n\r\n    <file path=\"catalog/controller/extension/module/{latest,special}*.php\">\r\n        <operation>\r\n            <search><![CDATA[$data[\'products\'] = array();]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if (isset($this->request->server[\'HTTPS\']) && (($this->request->server[\'HTTPS\'] == \'on\') || ($this->request->server[\'HTTPS\'] == \'1\'))) {\r\n                    $data[\'base\'] = $this->config->get(\'config_ssl\');\r\n                } else {\r\n                    $data[\'base\'] = $this->config->get(\'config_url\');\r\n                }\r\n\r\n                $this->load->model(\'setting/setting\');\r\n                $data[\'cfp_setting\'] = $this->model_setting_setting->getSetting(\'module_so_call_for_price\');\r\n\r\n                if (!defined (\'FANCYBOX\'))\r\n					{\r\n					$this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/jquery.fancybox.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/jquery.fancybox.js\');\r\n					define( \'FANCYBOX\', 1 );\r\n				}\r\n                if (!defined (\'so_call_for_price\')){\r\n                   \r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/style.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/script.js\');\r\n                    define( \'so_call_for_price\', 1 );\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$result[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ((float)$result[\'price\']) {\r\n                    $price_0 = $result[\'price\'];\r\n                }\r\n                else {\r\n                    $price_0 = false;\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'price\'       => $price,]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'price_0\'       => $price_0,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n\r\n    <file path=\"catalog/controller/product/{category,manufacturer,search,special}*.php\">\r\n        <operation>\r\n            <search><![CDATA[$this->load->model(\'tool/image\');]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                if (isset($this->request->server[\'HTTPS\']) && (($this->request->server[\'HTTPS\'] == \'on\') || ($this->request->server[\'HTTPS\'] == \'1\'))) {\r\n                    $data[\'base\'] = $this->config->get(\'config_ssl\');\r\n                } else {\r\n                    $data[\'base\'] = $this->config->get(\'config_url\');\r\n                }\r\n                \r\n                $this->load->model(\'setting/setting\');\r\n                $data[\'cfp_setting\'] = $this->model_setting_setting->getSetting(\'module_so_call_for_price\');\r\n\r\n                if (!defined (\'so_call_for_price\')){\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/jquery.fancybox.css\');\r\n                    //$this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/jquery.fancybox.js\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/style.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/script.js\');\r\n                    define( \'so_call_for_price\', 1 );\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$result[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ((float)$result[\'price\']) {\r\n                    $price_0 = $result[\'price\'];\r\n                } else {\r\n                    $price_0 = false;\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'price\'       => $price,]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'price_0\'  => $price_0,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/view/theme/*/template/product/{category,manufacturer_info,search,special}*.twig\">\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[{{ product.price }}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'0\' %}\r\n                        <a data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" href=\"javascript:;\" class=\"callforprice\" style=\"color: #ff0000; font-weight: bold;\"><i class=\"fa fa-phone\"></i> {{ text_price_0 }}</a>\r\n                    {% endif %}\r\n                {% else %}\r\n                    {{ product.price }}\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[{% if product.tax %}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if ((product.tax) and (cfp_setting.module_so_call_for_price_status) and (product.price_0 > 0)) %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<button type=\"button\" onclick=\"cart.add(\'{{ product.product_id }}\', \'{{ product.minimum }}\');\"><i class=\"fa fa-shopping-cart\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ button_cart }}</span></button>]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_hide_cart is defined and cfp_setting.module_so_call_for_price_hide_cart == \'0\' %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\">{{ text_price_0 }}</button>\r\n                        {% else %}\r\n                            <button type=\"button\" style=\"cursor: default; background-color: #eee; color: #ccc;\"><i class=\"fa fa-shopping-cart\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ button_cart }}</span></button>\r\n                        {% endif %}\r\n                    {% else %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\">{{ text_price_0 }}</button>\r\n                        {% endif %}\r\n                    {% endif %}\r\n                {% else %}\r\n                    <button type=\"button\" onclick=\"cart.add(\'{{ product.product_id }}\', \'{{ product.minimum }}\');\"><i class=\"fa fa-shopping-cart\"></i> <span class=\"hidden-xs hidden-sm hidden-md\">{{ button_cart }}</span></button>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n\r\n    <file path=\"catalog/controller/product/product.php\">\r\n        <operation>\r\n            <search><![CDATA[$this->load->model(\'catalog/category\');]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if (isset($this->request->server[\'HTTPS\']) && (($this->request->server[\'HTTPS\'] == \'on\') || ($this->request->server[\'HTTPS\'] == \'1\'))) {\r\n                    $data[\'base\'] = $this->config->get(\'config_ssl\');\r\n                } else {\r\n                    $data[\'base\'] = $this->config->get(\'config_url\');\r\n                }\r\n                \r\n                $this->load->model(\'setting/setting\');\r\n                $data[\'cfp_setting\'] = $this->model_setting_setting->getSetting(\'module_so_call_for_price\');\r\n\r\n                if (!defined (\'so_call_for_price\')){\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/jquery.fancybox.css\');\r\n                    //$this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/jquery.fancybox.js\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/style.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/script.js\');\r\n                    define( \'so_call_for_price\', 1 );\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$product_info[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ((float)$product_info[\'price\']) {\r\n                    $data[\'price_0\'] = $product_info[\'price\'];\r\n                } else {\r\n                    $data[\'price_0\'] = false;\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$result[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ((float)$result[\'price\']) {\r\n                    $price_0 = $result[\'price\'];\r\n                } else {\r\n                    $price_0 = false;\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'price\'       => $price,]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'price_0\'  => $price_0,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/view/theme/*/template/product/product.twig\">\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[{{ price }}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'0\' %}\r\n                        <a data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" href=\"javascript:;\" class=\"callforprice\" style=\"color: #ff0000; font-weight: bold; font-size: 18px;\"><i class=\"fa fa-phone\" style=\"font-size: 18px;\"></i> {{ text_price_0 }}</a>\r\n                    {% endif %}        \r\n                {% else %}\r\n                    {{ price }}\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[{% if tax %}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if ((tax) and (cfp_setting.module_so_call_for_price_status) and (price_0 > 0)) %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[{{ price }}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'0\' %}\r\n                        <a data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" href=\"javascript:;\" class=\"callforprice\" style=\"color: #ff0000; font-weight: bold;\"><i class=\"fa fa-phone\"></i> {{ text_price_0 }}</a>\r\n                    {% endif %}\r\n                {% else %}\r\n                    {{ price }}\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[{% if product.tax %}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if ((product.tax) and (cfp_setting.module_so_call_for_price_status) and (product.price_0 > 0)) %}\r\n            ]]></add>\r\n        </operation>\r\n  </file>\r\n  <file path=\"catalog/view/theme/*/template/product/product.twig\">\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[<input type=\"button\" value=\"{{ button_cart }}\" data-loading-text=\"{{ text_loading }}\" id=\"button-cart\" class=\"btn btn-mega btn-lg\">]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_hide_cart is defined and cfp_setting.module_so_call_for_price_hide_cart == \'0\' %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <input type=\"button\" value=\"{{ text_price_0 }}\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" data-loading-text=\"{{ text_loading }}\" class=\"btn btn-mega btn-lg callforprice\">\r\n                        {% else %}\r\n                            <input type=\"button\" value=\"{{ button_cart }}\" data-loading-text=\"{{ text_loading }}\" class=\"btn btn-mega btn-lg\" style=\"cursor: default; background: #eee; color: #ccc; border: 1px solid #eee; text-shadow: none; box-shadow: none;\">\r\n                        {% endif %}\r\n                    {% else %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <input type=\"button\" value=\"{{ text_price_0 }}\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" data-loading-text=\"{{ text_loading }}\" class=\"btn btn-mega btn-lg \">\r\n                        {% endif %}\r\n                    {% endif %}\r\n                {% else %}\r\n                    <input type=\"button\" value=\"{{ button_cart }}\" data-loading-text=\"{{ text_loading }}\" id=\"button-cart\" class=\"btn btn-mega btn-lg\" />\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<button class=\"addToCart btn-button\" type=\"button\" title=\"{{ button_cart}}\" onclick=\"cart.add(\'{{ product.product_id }}\', \'{{ product.minimum }}\');\"><i class=\"fa fa-shopping-basket\"></i><span>{{ button_cart }}</span></button>]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_hide_cart is defined and cfp_setting.module_so_call_for_price_hide_cart == \'0\' %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\">{{ text_price_0 }}</button>\r\n                        {% else %}\r\n                            <button type=\"button\" style=\"cursor: default; background-color: #eee; color: #ccc;\"><span class=\"hidden-xs hidden-sm hidden-md\">{{ button_cart }}</span> <i class=\"fa fa-shopping-cart\"></i></button>\r\n                        {% endif %}\r\n                    {% else %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button class=\"callforprice\" type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\">{{ text_price_0 }}</button>\r\n                        {% endif %}\r\n                    {% endif %}\r\n                {% else %}\r\n                    <button class=\"addToCart btn-button\" type=\"button\" title=\"{{ button_cart}}\" onclick=\"cart.add(\'{{ product.product_id }}\', \'{{ product.minimum }}\');\"><i class=\"fa fa-shopping-basket\"></i><span>{{ button_cart }}</span></button>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n\r\n    <file path=\"catalog/controller/account/wishlist.php\">\r\n        <operation>\r\n            <search><![CDATA[$this->load->model(\'tool/image\');]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                if (isset($this->request->server[\'HTTPS\']) && (($this->request->server[\'HTTPS\'] == \'on\') || ($this->request->server[\'HTTPS\'] == \'1\'))) {\r\n                    $data[\'base\'] = $this->config->get(\'config_ssl\');\r\n                } else {\r\n                    $data[\'base\'] = $this->config->get(\'config_url\');\r\n                }\r\n                \r\n                $this->load->model(\'setting/setting\');\r\n                $data[\'cfp_setting\'] = $this->model_setting_setting->getSetting(\'module_so_call_for_price\');\r\n\r\n                if (!defined (\'so_call_for_price\')){\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/jquery.fancybox.css\');\r\n                    //$this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/jquery.fancybox.js\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/style.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/script.js\');\r\n                    define( \'so_call_for_price\', 1 );\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$product_info[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ((float)$product_info[\'price\']) {\r\n                    $price_0 = $product_info[\'price\'];\r\n                } else {\r\n                    $price_0 = false;\r\n                }]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'price\'      => $price,]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'price_0\'  => $price_0,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/view/theme/*/template/account/wishlist.twig\">\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[{{ product.price }}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    <a data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" href=\"javascript:;\" class=\"callforprice\" style=\"color: #ff0000; font-weight: bold;\"><i class=\"fa fa-phone\"></i> {{ text_price_0 }}</a>\r\n                {% else %}\r\n                    {{ product.price }}\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<button type=\"button\" onclick=\"cart.add(\'{{ product.product_id }}\');\" data-toggle=\"tooltip\" title=\"{{ button_cart }}\" class=\"btn btn-primary\"><i class=\"fa fa-shopping-cart\"></i></button>]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_hide_cart is defined and cfp_setting.module_so_call_for_price_hide_cart == \'0\' %}\r\n                        <button type=\"button\" class=\"btn btn-primary\" style=\"cursor: default; background: #eee; color: #ccc; border: 1px solid #eee; text-shadow: none; box-shadow: none;\"><i class=\"fa fa-shopping-cart\"></i></button>\r\n                    {% endif %}\r\n                {% else %}\r\n                    <button type=\"button\" onclick=\"cart.add(\'{{ product.product_id }}\');\" data-toggle=\"tooltip\" title=\"{{ button_cart }}\" class=\"btn btn-primary\"><i class=\"fa fa-shopping-cart\"></i></button>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n\r\n    <file path=\"catalog/controller/product/compare.php\">\r\n        <operation>\r\n            <search><![CDATA[$this->load->model(\'tool/image\');]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                if (isset($this->request->server[\'HTTPS\']) && (($this->request->server[\'HTTPS\'] == \'on\') || ($this->request->server[\'HTTPS\'] == \'1\'))) {\r\n                    $data[\'base\'] = $this->config->get(\'config_ssl\');\r\n                } else {\r\n                    $data[\'base\'] = $this->config->get(\'config_url\');\r\n                }\r\n                \r\n                $this->load->model(\'setting/setting\');\r\n                $data[\'cfp_setting\'] = $this->model_setting_setting->getSetting(\'module_so_call_for_price\');\r\n\r\n                if (!defined (\'so_call_for_price\')){\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/jquery.fancybox.css\');\r\n                    //$this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/jquery.fancybox.js\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/style.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/script.js\');\r\n                    define( \'so_call_for_price\', 1 );\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$product_info[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ((float)$product_info[\'price\']) {\r\n                    $price_0 = $product_info[\'price\'];\r\n                } else {\r\n                    $price_0 = false;\r\n                }]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'price\'        => $price,]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'price_0\'  => $price_0,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/view/theme/*/template/product/compare.twig\">\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[{{ product.price }}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'0\' %}\r\n                        <a data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" href=\"javascript:;\" class=\"callforprice\" style=\"color: #ff0000; font-weight: bold;\"><i class=\"fa fa-phone\"></i> {{ text_price_0 }}</a>\r\n                    {% endif %}\r\n                {% else %}\r\n                    {{ product.price }}\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<input type=\"button\" value=\"{{ button_cart }}\" class=\"btn btn-primary btn-block\" onclick=\"cart.add(\'{{ product.product_id }}\', \'{{ product.minimum }}\');\" />]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_hide_cart is defined and cfp_setting.module_so_call_for_price_hide_cart == \'0\' %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <input type=\"button\" value=\"{{ text_price_0 }}\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" class=\"btn btn-primary btn-block\" />\r\n                        {% else %}\r\n                            <input type=\"button\" value=\"{{ button_cart }}\" class=\"btn btn-primary btn-block\" style=\"cursor: default; background: #eee; color: #ccc; border: 1px solid #eee; text-shadow: none; box-shadow: none;\" />\r\n                        {% endif %}\r\n                    {% else %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <input type=\"button\" value=\"{{ text_price_0 }}\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" class=\"btn btn-primary btn-block\" />\r\n                        {% endif %}\r\n                    {% endif %}\r\n                {% else %}\r\n                    <input type=\"button\" value=\"{{ button_cart }}\" class=\"btn btn-primary btn-block\" onclick=\"cart.add(\'{{ product.product_id }}\', \'{{ product.minimum }}\');\" />\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n  	<file path=\"catalog/controller/extension/module/so_filter_shop_by.php\">\r\n        <operation>\r\n            <search><![CDATA[$this->load->model(\'extension/module/so_filter_shop_by\');]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                if (isset($this->request->server[\'HTTPS\']) && (($this->request->server[\'HTTPS\'] == \'on\') || ($this->request->server[\'HTTPS\'] == \'1\'))) {\r\n                    $data[\'base\'] = $this->config->get(\'config_ssl\');\r\n                } else {\r\n                    $data[\'base\'] = $this->config->get(\'config_url\');\r\n                }\r\n\r\n                $this->load->model(\'setting/setting\');\r\n                $setting[\'cfp_setting\'] = $this->model_setting_setting->getSetting(\'module_so_call_for_price\');\r\n\r\n                if (!defined (\'so_call_for_price\')){\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/jquery.fancybox.css\');\r\n                    //$this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/jquery.fancybox.js\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/style.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/script.js\');\r\n                    define( \'so_call_for_price\', 1 );\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$result[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ($result[\'price\']) {\r\n                    $price_0 = $result[\'price\'];\r\n                }\r\n                else {\r\n                    $price_0 = false;\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'price\'       => $price,]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'price_0\'       => $price_0,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n  \r\n    <file path=\"catalog/view/theme/*/template/soconfig/listing.twig\">\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[{{ product.price }}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'0\' %}\r\n                        <a data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" href=\"javascript:;\" class=\"callforprice\" style=\"color: #ff0000; font-weight: bold;\"><i class=\"fa fa-phone\"></i> {{ text_price_0 }}</a>\r\n                    {% endif %}\r\n                {% else %}\r\n                    {{ product.price }}\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<button class=\"addToCart btn-button\" type=\"button\" title=\"{{ button_cart }}\" onclick=\"cart.add(\'{{ product.product_id }}\', \'{{ product.minimum }}\');\"><i class=\"fa fa-shopping-basket\"></i><span>{{ button_cart }}</span></button>]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_hide_cart is defined and cfp_setting.module_so_call_for_price_hide_cart == \'0\' %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button class=\"addToCart btn-button callforprice\" type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\"><i class=\"fa fa-phone\"></i><span>{{ text_price_0 }}</span></button>\r\n                        {% else %}\r\n                            <button class=\"addToCart btn-button\" type=\"button\" title=\"{{ button_cart}}\" style=\"cursor: default; background-color: #eee; color: #ccc;\"><i class=\"fa fa-shopping-basket\"></i><span>{{ button_cart }}</span></button>\r\n                        {% endif %}\r\n                    {% else %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button class=\"addToCart btn-button callforprice\" type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\"><i class=\"fa fa-phone\"></i><span>{{ text_price_0 }}</span></button>\r\n                        {% endif %}\r\n                    {% endif %}\r\n                {% else %}\r\n                    <button class=\"addToCart btn-button\" type=\"button\" title=\"{{ button_cart }}\" onclick=\"cart.add(\'{{ product.product_id }}\', \'{{ product.minimum }}\');\"><i class=\"fa fa-shopping-basket\"></i><span>{{ button_cart }}</span></button>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    \r\n    \r\n	<file path=\"catalog/controller/extension/module/so_listing_tabs.php\">\r\n        <operation>\r\n            <search><![CDATA[$this->load->model(\'extension/module/so_listing_tabs\');]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                if (isset($this->request->server[\'HTTPS\']) && (($this->request->server[\'HTTPS\'] == \'on\') || ($this->request->server[\'HTTPS\'] == \'1\'))) {\r\n                    $data[\'base\'] = $this->config->get(\'config_ssl\');\r\n                } else {\r\n                    $data[\'base\'] = $this->config->get(\'config_url\');\r\n                }\r\n\r\n                $this->load->model(\'setting/setting\');\r\n                $setting[\'cfp_setting\'] = $this->model_setting_setting->getSetting(\'module_so_call_for_price\');\r\n\r\n                if (!defined (\'so_call_for_price\')){\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/jquery.fancybox.css\');\r\n                    //$this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/jquery.fancybox.js\');\r\n                    $this->document->addStyle(\'catalog/view/javascript/so_call_for_price/css/style.css\');\r\n                    $this->document->addScript(\'catalog/view/javascript/so_call_for_price/js/script.js\');\r\n                    define( \'so_call_for_price\', 1 );\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[if ((float)$product_info[\'special\']) {]]></search>\r\n            <add position=\"before\"><![CDATA[\r\n                if ((float)$product_info[\'price\']) {\r\n                    $price_0 = $product_info[\'price\'];\r\n                }\r\n                else {\r\n                    $price_0 = false;\r\n                }\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[\'price\'       	=> $price,]]></search>\r\n            <add position=\"after\"><![CDATA[\r\n                \'price_0\'       => $price_0,\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    <file path=\"catalog/view/theme/*/template/extension/module/so_listing_tabs/*/default_items.twig\">\r\n        <operation>\r\n            <search index=\"0\"><![CDATA[{{ product.price }}]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'0\' %}\r\n                        <a data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\" href=\"javascript:;\" class=\"callforprice\" style=\"color: #ff0000; font-weight: bold;\"><i class=\"fa fa-phone\"></i> {{ text_price_0 }}</a>\r\n                    {% endif %}\r\n                {% else %}\r\n                    {{ product.price }}\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n        <operation>\r\n            <search><![CDATA[<button type=\"button\" class=\"addToCart btn-button\" title=\"{{ objlang.get(\'button_cart\') }}\" onclick=\"cart.add(\'{{ product.product_id }} \');\"><i class=\"fa fa-shopping-basket\"></i><span>{{ objlang.get(\'button_cart\') }} </span></button>]]></search>\r\n            <add position=\"replace\"><![CDATA[\r\n                {% if (cfp_setting.module_so_call_for_price_status and product.price_0 <= 0) %}\r\n                    {% if cfp_setting.module_so_call_for_price_hide_cart is defined and cfp_setting.module_so_call_for_price_hide_cart == \'0\' %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button class=\"addToCart btn-button callforprice\" type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\"><i class=\"fa fa-phone\"></i><span>{{ text_price_0 }}</span></button>\r\n                        {% else %}\r\n                            <button class=\"addToCart btn-button\" type=\"button\" title=\"{{ button_cart}}\" style=\"cursor: default; background-color: #eee; color: #ccc;\"><i class=\"fa fa-shopping-basket\"></i><span>{{ button_cart }}</span></button>\r\n                        {% endif %}\r\n                    {% else %}\r\n                        {% if cfp_setting.module_so_call_for_price_replace_cart is defined and cfp_setting.module_so_call_for_price_replace_cart == \'1\' %}\r\n                            <button class=\"addToCart btn-button callforprice\" type=\"button\" data-fancybox data-type=\"ajax\" data-src=\"{{ base }}index.php?route=extension/module/so_call_for_price&product_id={{ product.product_id }}\"><i class=\"fa fa-phone\"></i><span>{{ text_price_0 }}</span></button>\r\n                        {% endif %}\r\n                    {% endif %}\r\n                {% else %}\r\n                    <button type=\"button\" class=\"addToCart btn-button\" title=\"{{ objlang.get(\'button_cart\') }}\" onclick=\"cart.add(\'{{ product.product_id }} \');\"><i class=\"fa fa-shopping-basket\"></i><span>{{ objlang.get(\'button_cart\') }} </span></button>\r\n                {% endif %}\r\n            ]]></add>\r\n        </operation>\r\n    </file>\r\n    \r\n</modification>',1,'2018-04-23 15:19:45','2018-05-23 09:51:45'),(15,47,'So Google Amp (Accelerated Mobile Pages)','ocmod-googleamp','OpencartWorks','1.0.0','http://www.opencartWorks.com','<?xml version=\"1.0\" encoding=\"utf-8\"?> \r\n<modification> \r\n <name><![CDATA[So Google Amp (Accelerated Mobile Pages)]]></name> \r\n <code>ocmod-googleamp</code> \r\n <version><![CDATA[1.0.0]]></version> \r\n <author><![CDATA[OpencartWorks]]></author> \r\n <link>http://www.opencartWorks.com</link> \r\n  \r\n<!--========Catalog/language/product=============--> \r\n<file path=\"catalog/language/*/product/product.php\">\r\n  <operation> \r\n	<search ><![CDATA[// Entry]]></search>\r\n	<add position=\"after\"><![CDATA[\r\n	$_[\'text_comment\']     	= \' Comment\';\r\n]]></add>\r\n </operation>\r\n \r\n</file>  \r\n<!--========Catalog/controller/product=============--> \r\n<file path=\"catalog/controller/product/product.php\">\r\n  <operation> \r\n	\r\n	<search ><![CDATA[$this->document->addLink($this->url->link(\'product/product\', \'product_id=\' . $this->request->get[\'product_id\']), \'canonical\');]]></search>\r\n	<add position=\"after\"><![CDATA[\r\n	if($this->config->get(\'so_google_amp_status\')){\r\n	  $this->document->addLink($this->url->link(\'extension/amp/product\', \'product_id=\' . $this->request->get[\'product_id\']), \'amphtml\');\r\n	  if (isset($this->request->get[\'addcart\'])) {\r\n		  $this->cart->add($this->request->get[\'product_id\']);\r\n		  $this->response->redirect($this->url->link(\'checkout/cart\'));\r\n	  }\r\n	}\r\n]]></add>\r\n </operation>\r\n</file> \r\n\r\n<file path=\"catalog/controller/product/category.php\">\r\n  <operation> \r\n	<search ><![CDATA[$data[\'pagination\'] = $pagination->render();]]></search>\r\n	<add position=\"after\"><![CDATA[\r\n	if($this->config->get(\'so_google_amp_status\')){\r\n	  $this->document->addLink($this->url->link(\'extension/amp/category\', \'path=\' . $category_info[\'category_id\']), \'amphtml\');\r\n	  if (isset($this->request->get[\'addcart\'])) {\r\n		  $this->cart->add($this->request->get[\'product_id\']);\r\n		  $this->response->redirect($this->url->link(\'checkout/cart\'));\r\n	  }\r\n	}\r\n]]></add>\r\n </operation>\r\n</file> \r\n\r\n<file path=\"catalog/controller/startup/seo_url.php\">\r\n	<operation>\r\n		<search><![CDATA[if ($url[0] == \'product_id\') {]]></search>\r\n		<add position=\"before\"><![CDATA[\r\n		if ($url[0] == \'product_id\' && strpos($this->request->get[\'_route_\'], \"amp/\") !== FALSE) {\r\n			$this->request->get[\'aproduct_id\'] = $url[1];\r\n		}\r\n		if ($url[0] == \'category_id\' && strpos($this->request->get[\'_route_\'], \"amp/\") !== FALSE) {\r\n			if (!isset($this->request->get[\'apath\'])) {\r\n				$this->request->get[\'apath\'] = $url[1];\r\n			} else {\r\n				$this->request->get[\'apath\'] .= \'_\' . $url[1];\r\n			}\r\n		}\r\n		]]></add>\r\n	</operation>\r\n	<operation>\r\n		<search><![CDATA[foreach ($parts as $part) {]]></search>\r\n		<add position=\"after\"><![CDATA[if ( $part == \'amp\') {\r\n				continue;\r\n			} else\r\n		]]></add>\r\n	</operation>\r\n	<operation error=\"log\">\r\n		<search><![CDATA[\r\n			if (!isset($this->request->get[\'route\'])) {\r\n		]]></search>\r\n		<add position=\"after\"><![CDATA[\r\n			if (isset($this->request->get[\'aproduct_id\']) ) {\r\n				$this->request->get[\'route\'] = \'extension/amp/product\';\r\n			} elseif (isset($this->request->get[\'apath\']) ) {\r\n				$this->request->get[\'route\'] = \'extension/amp/category\';\r\n\r\n		]]></add>\r\n	</operation>\r\n	<operation error=\"log\">\r\n		<search><![CDATA[\r\n			if (isset($this->request->get[\'product_id\'])) {\r\n		]]></search>\r\n		<add position=\"replace\"><![CDATA[\r\n			} elseif (isset($this->request->get[\'product_id\']) ) {\r\n		]]></add>\r\n	</operation>\r\n	<operation error=\"log\">\r\n		<search><![CDATA[\r\n			($data[\'route\'] == \'information/information\' && $key == \'information_id\')\r\n		]]></search>\r\n		<add position=\"replace\"><![CDATA[\r\n			($data[\'route\'] == \'information/information\' && $key == \'information_id\') || ($data[\'route\'] == \'extension/amp/product\')\r\n		]]></add>\r\n	</operation>\r\n	<operation>\r\n		<search><![CDATA[\r\n			$url .= \'/\' . $query->row[\'keyword\'];\r\n		]]></search>\r\n		<add position=\"replace\" index=\"1\"><![CDATA[\r\n			if ($data[\'route\'] == \'extension/amp/product\') {\r\n				$url .=  \'/amp/\' . $query->row[\'keyword\'] .\'\';\r\n			}else if ($data[\'route\'] == \'extension/amp/category\') {\r\n				$url .=  \'/amp/\' . $query->row[\'keyword\'] .\'\';\r\n			}else {\r\n				$url .= \'/\' . $query->row[\'keyword\'];\r\n			}\r\n		\r\n		]]></add>\r\n	</operation>\r\n</file> \r\n\r\n</modification> ',1,'2018-05-17 16:02:01','0000-00-00 00:00:00'),(16,50,'So Tools','So-Tools','OpencartWorks','1.1.1','http://www.opencartworks.com/','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>So Tools</name>\r\n    <code>So-Tools</code>\r\n    <version>1.1.1</version>\r\n    <author>OpencartWorks</author>\r\n    <link>http://www.opencartworks.com/</link>\r\n    \r\n    <file path=\"catalog/controller/product/product.php\">\r\n		<operation>\r\n			<search><![CDATA[$this->load->model(\'catalog/manufacturer\');]]></search>\r\n			<add position=\"after\"><![CDATA[\r\n			    $so_recent_products = array();\r\n			    if (isset($this->request->cookie[\'sorecentproduct\'])) {\r\n				    $so_recent_products = explode(\',\', $this->request->cookie[\'sorecentproduct\']);\r\n			    } else if (isset($this->session->data[\'sorecentproduct\'])) {\r\n				    $so_recent_products = $this->session->data[\'sorecentproduct\'];\r\n			    }\r\n			    \r\n    			if (isset($this->request->get[\'route\']) && $this->request->get[\'route\'] == \'product/product\') {\r\n    				$product_id = $this->request->get[\'product_id\'];   \r\n    				$so_recent_products = array_diff($so_recent_products, array($product_id));\r\n    				array_unshift($so_recent_products, $product_id);\r\n    				setcookie(\'sorecentproduct\', implode(\',\', $so_recent_products), time() + 60 * 60 * 24 * 30, \'/\', $this->request->server[\'HTTP_HOST\']);\r\n    				if (!isset($this->session->data[\'sorecentproduct\']) || $this->session->data[\'sorecentproduct\'] != $so_recent_products) {\r\n    					$this->session->data[\'sorecentproduct\'] = $so_recent_products;\r\n    				}\r\n    			}\r\n			]]></add>\r\n		</operation>\r\n	</file>\r\n\r\n    <file path=\"admin/controller/design/layout.php\">\r\n        <operation>\r\n            <search>\r\n                <![CDATA[public function index() {]]>\r\n            </search>\r\n            <add position=\"after\">\r\n                <![CDATA[$this->check_All_Pages();]]>\r\n            </add>\r\n        </operation>\r\n    </file>\r\n    \r\n    <file path=\"admin/controller/design/layout.php\">\r\n        <operation>\r\n            <search>\r\n                <![CDATA[public function add() {]]>\r\n            </search>\r\n            <add position=\"before\">\r\n                <![CDATA[\r\n                public function check_All_Pages()\r\n                {\r\n                    $query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"layout WHERE LOWER(name) LIKE \'%all pages%\' LIMIT 1\");\r\n                    if ($query->num_rows) {\r\n                    \r\n                    }else{\r\n                        $sql = \"INSERT INTO \".DB_PREFIX.\"layout SET `name`=\'All Pages\'\";\r\n                        $query = $this->db->query( $sql );\r\n                    }\r\n                }\r\n                ]]>\r\n            </add>\r\n        </operation>\r\n    </file>\r\n    \r\n    <file path=\"catalog/model/design/layout.php\">\r\n        <operation>\r\n            <search>\r\n                <![CDATA[\r\n                $query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"layout_module WHERE layout_id = \'\" . (int)$layout_id . \"\' AND position = \'\" . $this->db->escape($position) . \"\' ORDER BY sort_order\");\r\n                ]]>\r\n            </search>\r\n            <add position=\"replace\">\r\n                <![CDATA[\r\n                    $query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"layout WHERE LOWER(name) LIKE \'%all pages%\' LIMIT 1\");\r\n                    if ($query->num_rows) {\r\n                        $query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"layout_module WHERE (layout_id = \'\" . (int)$layout_id . \"\' OR layout_id = \'\" . (int)$query->row[\'layout_id\'] . \"\') AND position = \'\" . $this->db->escape($position) . \"\' ORDER BY sort_order\");\r\n                    } else {\r\n                        $query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"layout_module WHERE layout_id = \'\" . (int)$layout_id . \"\' AND position = \'\" . $this->db->escape($position) . \"\' ORDER BY sort_order\");\r\n                    }\r\n                ]]>\r\n            </add>\r\n        </operation>\r\n    </file>\r\n</modification>',1,'2018-09-05 20:49:44','0000-00-00 00:00:00'),(17,0,'So Destino','so-destino-modification','OpenCartWorks','3.0.3.6','','<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<modification>\r\n    <name>So Destino</name>\r\n    <code>so-destino-modification</code>\r\n    <version>3.0.3.6</version>\r\n    <author>OpenCartWorks</author>\r\n    <link>http://www.opencartworks.com</link>\r\n    <file path=\"system/library/template/twig.php\">\r\n        <operation>\r\n          <search>\r\n            <![CDATA[$loader = new \\Twig\\Loader\\ArrayLoader(array($filename . \'.twig\' => $code));]]>\r\n          </search>\r\n          <add position=\"replace\">\r\n            <![CDATA[       \r\n            $loader = new \\Twig_Loader_Filesystem();\r\n            \r\n            if (defined(\'DIR_CATALOG\') && is_dir(DIR_MODIFICATION . \'admin/view/template/\')) {  \r\n                $loader->addPath(DIR_MODIFICATION . \'admin/view/template/\');\r\n            } elseif (is_dir(DIR_MODIFICATION . \'catalog/view/theme/\')) {\r\n                $loader->addPath(DIR_MODIFICATION . \'catalog/view/theme/\');\r\n            }\r\n            \r\n            $loader->addPath(DIR_TEMPLATE);]]>\r\n          </add>\r\n        </operation>\r\n      </file> \r\n    \r\n</modification>',1,'2020-10-30 14:42:29','2020-10-30 14:42:29'),(20,1,'ExcelPort','isense_excelport_3','iSenseLabs','3.0.2','http://feofan.net/','<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<modification>\n    <name><![CDATA[ExcelPort]]></name>\n	<code><![CDATA[isense_excelport_3]]></code>\n	<version><![CDATA[3.0.2]]></version>\n	<author><![CDATA[iSenseLabs]]></author>\n	<link><![CDATA[http://feofan.net/]]></link>\n	<file path=\"admin/view/template/catalog/product_list.twig\">\n		<operation>\n			<search><![CDATA[<i class=\"fa fa-copy\"></i></button>]]></search>\n			<add position=\"after\"><![CDATA[\n				<a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> \n			]]></add>\n		</operation>\n	</file>\n    <file path=\"admin/controller/catalog/category.php\">\n        <operation>\n            <search><![CDATA[$data[\'order\'] = $order;]]></search>\n            <add position=\"before\"><![CDATA[\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            ]]></add>\n        </operation>\n    </file>\n	<file path=\"admin/view/template/catalog/category_list.twig\">\n		<operation>\n			<search><![CDATA[<a href=\"{{ repair }}\" data-toggle=\"tooltip\" title=\"{{ button_rebuild }}\" class=\"btn btn-default\"><i class=\"fa fa-refresh\"></i></a>]]></search>\n			<add position=\"replace\"><![CDATA[\n				<a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> <a href=\"{{ repair }}\" data-toggle=\"tooltip\" title=\"{{ button_rebuild }}\" class=\"btn btn-default\"><i class=\"fa fa-refresh\"></i></a>\n			]]></add>\n		</operation>\n	</file>\n    <file path=\"admin/controller/catalog/option.php\">\n        <operation>\n            <search><![CDATA[$data[\'order\'] = $order;]]></search>\n            <add position=\"after\"><![CDATA[\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            ]]></add>\n        </operation>\n    </file>\n	<file path=\"admin/view/template/catalog/option_list.twig\">\n		<operation>\n			<search><![CDATA[<button type=\"button\" data-toggle=\"tooltip\" title=\"{{ button_delete }}\" class=\"btn btn-danger\" onclick=\"confirm(\'{{ text_confirm }}\') ? $(\'#form-option\').submit() : false;\"><i class=\"fa fa-trash-o\"></i></button>]]></search>\n			<add position=\"before\"><![CDATA[\n				<a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> \n			]]></add>\n		</operation>\n	</file>\n    <file path=\"admin/controller/catalog/attribute.php\">\n        <operation>\n            <search><![CDATA[$data[\'order\'] = $order;]]></search>\n            <add position=\"after\"><![CDATA[\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            ]]></add>\n        </operation>\n    </file>\n	<file path=\"admin/view/template/catalog/attribute_list.twig\">\n		<operation>\n			<search><![CDATA[<button type=\"button\" data-toggle=\"tooltip\" title=\"{{ button_delete }}\" class=\"btn btn-danger\" onclick=\"confirm(\'{{ text_confirm }}\') ? $(\'#form-attribute\').submit() : false;\"><i class=\"fa fa-trash-o\"></i></button>]]></search>\n			<add position=\"before\"><![CDATA[\n				<a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> \n			]]></add>\n		</operation>\n	</file>\n    <file path=\"admin/controller/catalog/attribute_group.php\">\n        <operation>\n            <search><![CDATA[$data[\'order\'] = $order;]]></search>\n            <add position=\"after\"><![CDATA[\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            ]]></add>\n        </operation>\n    </file>\n	<file path=\"admin/view/template/catalog/attribute_group_list.twig\">\n		<operation>\n			<search><![CDATA[<button type=\"button\" data-toggle=\"tooltip\" title=\"{{ button_delete }}\" class=\"btn btn-danger\" onclick=\"confirm(\'{{ text_confirm }}\') ? $(\'#form-attribute-group\').submit() : false;\"><i class=\"fa fa-trash-o\"></i></button>]]></search>\n			<add position=\"before\"><![CDATA[\n				<a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> \n			]]></add>\n		</operation>\n	</file>\n    <file path=\"admin/controller/customer/customer.php\">\n        <operation>\n            <search><![CDATA[$data[\'order\'] = $order;]]></search>\n            <add position=\"after\"><![CDATA[\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            ]]></add>\n        </operation>\n    </file>\n    <file path=\"admin/view/template/customer/customer_list.twig\">\n        <operation>\n            <search><![CDATA[<button type=\"button\" data-toggle=\"tooltip\" title=\"{{ button_delete }}\" class=\"btn btn-danger\" onclick=\"confirm(\'{{ text_confirm }}\') ? $(\'#form-customer\').submit() : false;\"><i class=\"fa fa-trash-o\"></i></button>]]></search>\n            <add position=\"before\"><![CDATA[\n                <a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> \n            ]]></add>\n        </operation>\n    </file>\n    <file path=\"admin/controller/customer/customer_group.php\">\n        <operation>\n            <search><![CDATA[$data[\'order\'] = $order;]]></search>\n            <add position=\"after\"><![CDATA[\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            ]]></add>\n        </operation>\n    </file>\n    <file path=\"admin/view/template/customer/customer_group_list.twig\">\n        <operation>\n            <search><![CDATA[<button type=\"button\" data-toggle=\"tooltip\" title=\"{{ button_delete }}\" class=\"btn btn-danger\" onclick=\"confirm(\'{{ text_confirm }}\') ? $(\'#form-customer-group\').submit() : false;\"><i class=\"fa fa-trash-o\"></i></button>]]></search>\n            <add position=\"before\"><![CDATA[\n                <a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> \n            ]]></add>\n        </operation>\n    </file>\n    <file path=\"admin/controller/sale/order.php\">\n        <operation>\n            <search><![CDATA[$data[\'order\'] = $order;]]></search>\n            <add position=\"after\"><![CDATA[\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            ]]></add>\n        </operation>\n    </file>\n	<file path=\"admin/view/template/sale/order_list.twig\">\n		<operation>\n			<search><![CDATA[<a href=\"{{ add }}\" data-toggle=\"tooltip\" title=\"{{ button_add }}\" class=\"btn btn-primary\"><i class=\"fa fa-plus\"></i></a>]]></search>\n			<add position=\"before\"><![CDATA[\n                <a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> \n            ]]></add>\n		</operation>\n	</file>\n    <file path=\"admin/controller/catalog/manufacturer.php\">\n        <operation>\n            <search><![CDATA[$data[\'order\'] = $order;]]></search>\n            <add position=\"after\"><![CDATA[\n                $data[\'user_token\'] = $this->session->data[\'user_token\'];\n            ]]></add>\n        </operation>\n    </file>\n    <file path=\"admin/view/template/catalog/manufacturer_list.twig\">\n        <operation>\n            <search><![CDATA[<button type=\"button\" data-toggle=\"tooltip\" title=\"{{ button_delete }}\" class=\"btn btn-danger\" onclick=\"confirm(\'{{ text_confirm }}\') ? $(\'#form-manufacturer\').submit() : false;\"><i class=\"fa fa-trash-o\"></i></button>]]></search>\n            <add position=\"before\"><![CDATA[\n                <a href=\"index.php?route=extension/module/excelport&user_token={{ user_token }}\" class=\"btn btn-info\" data-toggle=\"tooltip\" title=\"Export / Import\"><i class=\"fa fa-file-excel-o\"></i></a> \n            ]]></add>\n        </operation>\n    </file>\n    <file path=\"admin/controller/common/column_left.php\">\n        <operation>\n            <search><![CDATA[if ($this->user->hasPermission(\'access\', \'tool/log\')) {]]></search>\n            <add position=\"before\"><![CDATA[\n                if ($this->user->hasPermission(\'access\', \'extension/module/excelport\')) {\n                    $maintenance[] = array(\n                        \'name\'     => \'ExcelPort: Export / Import\',\n                        \'href\'     => $this->url->link(\'extension/module/excelport\', \'user_token=\' . $this->session->data[\'user_token\'], true),\n                        \'children\' => array()       \n                    );\n                }\n            ]]></add>\n        </operation>\n    </file>\n</modification>',1,'2021-05-17 00:23:15','0000-00-00 00:00:00');

--
