Hi all,
Does anyone know if it's possible to stop spiders from incrementing the products viewed entries?
I would really like to know what my customers are looking at not the spiders..
Cheers,
Phil
Hi all,
Does anyone know if it's possible to stop spiders from incrementing the products viewed entries?
I would really like to know what my customers are looking at not the spiders..
Cheers,
Phil
The counter is in the:
/includes/modules/pages/product_info/main_template_vars.php
You should be able to surround that with an IF so that spiders are not counted:
Code:if ($spider_flag == false) { // products_viewed code }
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
If you have that on the one under the select for:
Then it should work ...Code:$sql = "update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$_GET['products_id'] . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'"; if ($spider_flag == false) { $res = $db->Execute($sql); }
Be sure to test this and see how well the changes work for you and that it still counts guests and customers ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Yeah I did this:
seems to be working for customers/visitors just watching for spiders now :o)PHP Code://added to stop spiders incrementing
if ($spider_flag == false) {
$sql = "update " . TABLE_PRODUCTS_DESCRIPTION . "
set products_viewed = products_viewed+1
where products_id = '" . (int)$_GET['products_id'] . "'
and language_id = '" . (int)$_SESSION['languages_id'] . "'";
$res = $db->Execute($sql);
}
//added to stop spiders incrementing
couldn't be bothered to wait, fetched as googlebot from webmaster tools and no increment so seems to work a treat :)
Surprised this isnt already built in!
Thanks
Phil
Thanks for confirming that this worked for you ...
Some may want to know all counts ...
Personally, I'd like to see a count for spiders separate from the guest/customers ... but that is just me ...![]()
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Yeah could add an additional column in the table and have the second query run on the opposite logic to the if statement and then have the report show both.
I agree as it's still important to see that spiders are crawling all products so is an easy reference to check this.
Phil :)
Last edited by philip937; 26 Feb 2011 at 08:27 PM. Reason: Spelling noob
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
The basic idea is that there is a flag set for:
$spider_flag
so when the Counter tables are updated, you would do one thing for spiders and one thing for none spiders ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!