Post by inventer » Sun Feb 09, 2020 2:15 am

How to increase the Limit of Who is Online?
Hi every one
if you go in Reports > Who is Online it only shows 24h result Can any one tell me how to increase it

Newbie

Posts

Joined
Sat Feb 01, 2020 2:25 am

Post by straightlight » Sun Feb 09, 2020 9:22 am

While the OC version has not been posted, in your admin/controller/report/online.php file, look for:

Code: Select all

'limit'           => $this->config->get('config_limit_admin')
replace with:

Code: Select all

'limit'           => X
Where 'X' would be your number.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by IP_CAM » Sun Feb 09, 2020 10:12 am

seems to be the same in most all Versions, just the file name is a little different,
OC v.3.x online.php -- OC v.1.5.6.x customer_online.php
----

Code: Select all

'start'           => ($page - 1) * $this->config->get('config_limit_admin'),
'limit'           => $this->config->get('config_limit_admin') 
----
'start'           => ($page - 1) * 50,
'limit'           => 50

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by straightlight » Mon Feb 10, 2020 12:15 am

IP_CAM wrote:
Sun Feb 09, 2020 10:12 am
seems to be the same in most all Versions, just the file name is a little different,
OC v.3.x online.php -- OC v.1.5.6.x customer_online.php
----

Code: Select all

'start'           => ($page - 1) * $this->config->get('config_limit_admin'),
'limit'           => $this->config->get('config_limit_admin') 
----
'start'           => ($page - 1) * 50,
'limit'           => 50
The config_limit_admin key was not always built-in. On older OC versions until more recent ones, the limits were defined manually.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by inventer » Mon Feb 10, 2020 7:17 pm

Hi I have edit the code like you explained. then i checked the customer online table in database . and found out there was no entry more than 1 hour
i think there is some opencart code that is deleting entries older than 1 hour can any one tell how to filx it . it keeps at least 3 or 4 hour . 24 hour is the best

Newbie

Posts

Joined
Sat Feb 01, 2020 2:25 am

Post by straightlight » Mon Feb 10, 2020 9:15 pm

Unless you're using an extension, the only 1 hour interval being validated from the core is the system/library/cart/cart.php file.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by uksitebuilder » Tue Feb 11, 2020 5:52 am

Hi

Assuming you are using the latest version of OpenCart 3.0.3.2 at time of writing this

Edit: catalog/model/tool/online.php

Find:

Code: Select all

$this->db->query("DELETE FROM `" . DB_PREFIX . "customer_online` WHERE date_added < '" . date('Y-m-d H:i:s', strtotime('-1 hour')) . "'");
Change to suit (e.g. -24hours):

Code: Select all

$this->db->query("DELETE FROM `" . DB_PREFIX . "customer_online` WHERE date_added < '" . date('Y-m-d H:i:s', strtotime('-24 hours')) . "'");

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by straightlight » Tue Feb 11, 2020 7:17 am

uksitebuilder wrote:
Tue Feb 11, 2020 5:52 am
Hi

Assuming you are using the latest version of OpenCart 3.0.3.2 at time of writing this

Edit: catalog/model/tool/online.php

Find:

Code: Select all

$this->db->query("DELETE FROM `" . DB_PREFIX . "customer_online` WHERE date_added < '" . date('Y-m-d H:i:s', strtotime('-1 hour')) . "'");
Change to suit (e.g. -24hours):

Code: Select all

$this->db->query("DELETE FROM `" . DB_PREFIX . "customer_online` WHERE date_added < '" . date('Y-m-d H:i:s', strtotime('-24 hours')) . "'");
Good to know ...

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by inventer » Tue Feb 11, 2020 7:30 pm

Hi thank you Very much It worked .
uksitebuilder wrote:
Tue Feb 11, 2020 5:52 am
Hi

Assuming you are using the latest version of OpenCart 3.0.3.2 at time of writing this

Edit: catalog/model/tool/online.php

Find:

Code: Select all

$this->db->query("DELETE FROM `" . DB_PREFIX . "customer_online` WHERE date_added < '" . date('Y-m-d H:i:s', strtotime('-1 hour')) . "'");
Change to suit (e.g. -24hours):

Code: Select all

$this->db->query("DELETE FROM `" . DB_PREFIX . "customer_online` WHERE date_added < '" . date('Y-m-d H:i:s', strtotime('-24 hours')) . "'");
Can you also tell how to add H1 tag arround logo . i dont know where is source file

Newbie

Posts

Joined
Sat Feb 01, 2020 2:25 am
Who is online

Users browsing this forum: No registered users and 13 guests