Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Products Viewed - Exclude Spiders

    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

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Products Viewed - Exclude Spiders

    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!

  3. #3
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Products Viewed - Exclude Spiders

    Quote Originally Posted by Ajeh View Post
    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
    }


    will this do it? want to check first, dont want to break it..

    Code:
    if ($spider_flag == false) {
    $res = $db->Execute($sql);
    }
    ?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Products Viewed - Exclude Spiders

    If you have that on the one under the select for:
    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);
        }
    Then it should work ...

    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!

  5. #5
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Products Viewed - Exclude Spiders

    Yeah I did this:

    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 
    seems to be working for customers/visitors just watching for spiders now :o)

  6. #6
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Products Viewed - Exclude Spiders

    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

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Products Viewed - Exclude Spiders

    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!

  8. #8
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Products Viewed - Exclude Spiders

    Quote Originally Posted by Ajeh View Post
    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 ...
    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

  9. #9
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Products Viewed - Exclude Spiders

    Quote Originally Posted by Ajeh View Post
    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 ...
    I HATE to bump an old post.. But how could this separate count be implemented??
    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.

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Products Viewed - Exclude Spiders

    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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. People who viewed this also viewed For Zen Cart?
    By CoolCarPartsOnline in forum General Questions
    Replies: 3
    Last Post: 26 May 2009, 02:04 AM
  2. Replies: 12
    Last Post: 24 Jul 2008, 09:36 PM
  3. Exclude certain categories from spiders
    By Blake81 in forum General Questions
    Replies: 0
    Last Post: 10 Dec 2007, 12:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg