<?xml version="1.0" encoding="utf-8"?>
<modification>
 <name>So Tools</name>
 <code>So-Tools</code>
 <version>1.1.1</version>
 <author>OpenCartWorks</author>
 <link>http://www.opencartworks.com/</link>
 
 <file path="catalog/controller/product/product.php">
 <operation>
 <search><![CDATA[$this->load->model('catalog/manufacturer');]]></search>
 <add position="after"><![CDATA[
 $so_recent_products = array();
 if (isset($this->request->cookie['sorecentproduct'])) {
 $so_recent_products = explode(',', $this->request->cookie['sorecentproduct']);
 } else if (isset($this->session->data['sorecentproduct'])) {
 $so_recent_products = $this->session->data['sorecentproduct'];
 }
 
 if (isset($this->request->get['route']) && $this->request->get['route'] == 'product/product') {
 $product_id = $this->request->get['product_id']; 
 $so_recent_products = array_diff($so_recent_products, array($product_id));
 array_unshift($so_recent_products, $product_id);
 setcookie('sorecentproduct', implode(',', $so_recent_products), time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
 if (!isset($this->session->data['sorecentproduct']) || $this->session->data['sorecentproduct'] != $so_recent_products) {
 $this->session->data['sorecentproduct'] = $so_recent_products;
 }
 }
 ]]></add>
 </operation>
 </file>

</modification> 