Go to database and you must add a new filed on table oc_customer_online with AUTO_INCREMENT
or
DELETE the table oc_customer_online
and create a new one, run this SQL code
Code: Select all
CREATE TABLE `oc_customer_online` (
`id` int(11) NOT NULL,
`ip` varchar(40) NOT NULL,
`customer_id` int(11) NOT NULL,
`url` text NOT NULL,
`referer` text NOT NULL,
`date_added` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `oc_customer_online`
ADD PRIMARY KEY (`id`);
ALTER TABLE `oc_customer_online` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
in catalog/model/tool/online.php
Code: Select all
$this->db->query("UPDATE INTO " . DB_PREFIX . "customer_online SET ip = '" . $this->db->escape($ip) . "', customer_id = '" . (int)$customer_id . "', url = '" . $this->db->escape($url) . "', referer = '" . $this->db->escape($referer) . "', date_added = '" . $this->db->escape(date('Y-m-d H:i:s')) . "'");
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_online SET ip = '" . $this->db->escape($ip) . "', customer_id = '" . (int)$customer_id . "', url = '" . $this->db->escape($url) . "', referer = '" . $this->db->escape($referer) . "', date_added = '" . $this->db->escape(date('Y-m-d H:i:s')) . "'");