I can't get the below to work nothing is inserted in to the database,
can you help me on this please.
this is the code I have in includes\classes\observers\class.bh_products_viewed_counter.php
PHP Code:
<?php
/** * @copyright Copyright 2003-2022 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: DrByte 2020 Jul 28 Modified in v1.5.8-alpha $ * * Designed for v1.5.7 */
class bh_products_viewed_counter extends base{ function __construct() { $this->attach($this, array('NOTIFY_PRODUCT_VIEWS_HIT_INCREMENTOR')); } function update(&$class, $eventID, $paramsArray = array()) { global $db;
$sql = "INSERT INTO `ctgvzfpjxs`.`customers_browsing_history` AS `customers_browsing_history` (`products_id`, `customers_id`, `date_added`) VALUES (" . (int) $paramsArray . ", " . (int) $_SESSION['customer_id'] . ", now())"; $res = $db->Execute($sql); }
}
this is the code I have in admin\includes\extra_datafiles\browsing_history_database_tables.php
and in includes\extra_datafiles\browsing_history_database_tables.php
PHP Code:
<?php
/** * browsing history Database Table Name Definitions. * * @package browsing history * @author Simon * @copyright Copyright 2023-2024 Simon * @copyright Portions Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @link * @license http://www.gnu.org/copyleft/gpl.html GNU Public License V2.0 * @version $Id: browsing_history_database_tables.php 07-03-2024 Simon $ */
if (!defined('DB_PREFIX')) { define('DB_PREFIX', '');}
define('TABLE_BROWSING_HISTORY', DB_PREFIX . 'browsing_history');define('TABLE_CUSTOMERS_BROWSING_HISTORY', DB_PREFIX . 'customers_browsing_history');
this is the database table
Bookmarks