do you know anything about the observer process in ZC?
create this file and place it in the admin observer directory to see them on the admin side or store facing observer directory to see on the store side. one or the other or both. as such:
includes/classes/observers/auto.parsetime_display.php
YOUR_ADMIN/includes/classes/observers/auto.parsetime_display.php
PHP Code:
<?php
/**
* Designed for v1.5.7
*
* @copyright Copyright 2003-2020 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
*/
class zcObserverParsetimeDisplay extends base
{
public function __construct()
{
$this->attach($this, [
'NOTIFY_ADMIN_FOOTER_END',
]);
// do not register/attach for catalog-side if not enabled
// if (!defined('DISPLAY_PAGE_PARSE_TIME') || DISPLAY_PAGE_PARSE_TIME != 'true') {
// return;
// }
$this->attach($this, [
'NOTIFY_FOOTER_END',
]);
}
public function update(&$class, $eventID, $paramsArray)
{
$time_start = explode(' ', PAGE_PARSE_START_TIME);
$time_end = explode(' ', microtime());
$parse_time = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
$this->output($parse_time);
}
public function output($parse_time)
{
global $db;
?>
<div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Numbename it r of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo round($db->queryTime(), 5); ?></div>
<?php
}
}
best.
Bookmarks