Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated functions #25

Merged
merged 1 commit into from
Apr 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 15 additions & 19 deletions statsdata.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,21 @@ private function getScriptCustomerPagesViews($params)

return '<script type="text/javascript">
var time_start;
$(window).load(
function() {
time_start = new Date();
}
);
$(window).unload(
function() {
var time_end = new Date();
var pagetime = new FormData();
pagetime.append("type", "pagetime");
pagetime.append("id_connections", "' . (int) $token_array['id_connections'] . '");
pagetime.append("id_page", "' . (int) $token_array['id_page'] . '");
pagetime.append("time_start", "' . $token_array['time_start'] . '");
pagetime.append("token", "' . $token . '");
pagetime.append("time", time_end-time_start);
pagetime.append("ajax", "1");
navigator.sendBeacon("' . Context::getContext()->link->getPageLink('statistics', (bool) (Tools::getShopProtocol() == 'https://')) . '", pagetime);
}
);
$(window).on("load", function (e) {
time_start = new Date();
});
$(window).on("unload", function (e) {
var time_end = new Date();
var pagetime = new FormData();
pagetime.append("type", "pagetime");
pagetime.append("id_connections", "' . (int) $token_array['id_connections'] . '");
pagetime.append("id_page", "' . (int) $token_array['id_page'] . '");
pagetime.append("time_start", "' . $token_array['time_start'] . '");
pagetime.append("token", "' . $token . '");
pagetime.append("time", time_end-time_start);
pagetime.append("ajax", "1");
navigator.sendBeacon("' . Context::getContext()->link->getPageLink('statistics', (bool) (Tools::getShopProtocol() == 'https://')) . '", pagetime);
});
</script>';
}

Expand Down