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

Product views report #9713

Closed
chulcha opened this issue Jun 15, 2021 · 3 comments
Closed

Product views report #9713

chulcha opened this issue Jun 15, 2021 · 3 comments
Labels
master-branch Main branch of the project

Comments

@chulcha
Copy link

chulcha commented Jun 15, 2021

All versions

$query = $this->db->query("SELECT SUM(`viewed`) AS `total` FROM `" . DB_PREFIX . "product`");

$query = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "product` WHERE `viewed` > '0'");

Need add

LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) 
		WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'

Also, I would like to have sorting and filtering
But this can be left for developers too.

@WebkulOpencart WebkulOpencart added the master-branch Main branch of the project label Jun 16, 2021
@TheCartpenter
Copy link
Contributor

Using SUM is not the same as COUNT and viewed higher than 0 will not provide the same result as SUM ... as for the language ID, however, that'd be correct.

@chulcha
Copy link
Author

chulcha commented Jun 18, 2021

Using SUM is not the same as COUNT and viewed higher than 0 will not provide the same result as SUM ... as for the language ID, however, that'd be correct.

Get your a..s..s.. if you don't understand what this is about

@danielkerr
Copy link
Member

code has changed also not a clue what u are actually doing with these changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master-branch Main branch of the project
Projects
None yet
Development

No branches or pull requests

4 participants