Bringing this thread to life again. I there any way to get this working in v1.51?
the update of the products viewed count now appears to be in \classes\observers\class.products_viewed_counter.php as
function update(&$class, $eventID, $paramsArray = array())
{
if ($eventID == 'NOTIFY_PRODUCT_VIEWS_HIT_INCREMENTOR')
{
if (defined('LEGACY_PRODUCTS_VIEWED_COUNTER') && LEGACY_PRODUCTS_VIEWED_COUNTER == 'on')
{
global $db;
$sql = "update " . TABLE_PRODUCTS_DESCRIPTION . "
set products_viewed = products_viewed+1
where products_id = '" . (int)$paramsArray . "'
and language_id = '" . (int)$_SESSION['languages_id'] . "'";
$res = $db->Execute($sql);
}
}
}
}
I've added the spider_flag like so
{
global $db;
if ($spider_flag == false) {
$sql = "update " . TABLE_PRODUCTS_DESCRIPTION . "
set products_viewed = products_viewed+1
where products_id = '" . (int)$paramsArray . "'
and language_id = '" . (int)$_SESSION['languages_id'] . "'";
$res = $db->Execute($sql);
}
}
}
but it has no effect on the view counter increment. No doubt something a little bit smarter is needed.