Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2008
    Posts
    196
    Plugin Contributions
    0

    Default Counter History Time Off

    Time History for the Last 10 days is off

    Once I moved to a new server , before the day is over, it starts counting hits on the next day, while also counting on the current day.


    Counter History for last 10 recorded days Session - Total
    03/21/2019 1 - 1
    03/20/2019 793 - 3552 (this is today its 8pm here, its still adding counts to this day, but started for the next day already)
    03/19/2019 690 - 2585
    03/18/2019 443 - 1622
    03/17/2019 763 - 2794
    03/16/2019 392 - 1572
    03/15/2019 382 - 1420
    03/14/2019 654 - 1743
    03/13/2019 424 - 2284
    03/12/2019 480 - 2315

    I use PHP 5.6.4

    My host said maybe since the PHP time is set to universal time code, this could be the error? He said I could manually change the PHP to read pacific time, would this fix the error?

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Zen Cart Counter History Time Off

    Sounds like you need to edit /includes/extra_configures/set_time_zone.php to match your (rather than your webhost's) time-zone:
    Code:
    <?php
    /**
     * @package initSystem
     * @copyright Copyright 2003-2018 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: Drbyte Tue Sep 11 15:54:43 2018 -0400 Modified in v1.5.6 $
     */
    /*
     * Set time zone
    */
      // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
      $TZ = '';  // eg: 'Europe/Oslo'
    
    
    
      /**
       * MAKE NO CHANGES BELOW THIS LINE
       *
       * The following will take the timezone you specified above and apply it in your store.
       * If you didn't specify one, it will try to use the setting from your server's PHP configuration
       */
      if ($TZ == '') {
        $TZ = date_default_timezone_get();
      }
      if ($TZ != '') {
        putenv('TZ=' . $TZ);
        @date_default_timezone_set($TZ);
      }
    Follow the link just above the $TZ = ''; line to find the value that you'll need to set the cart's time to yours. Setting it in that one file will cause that time-zone to be used for the admin and the storefront.

  3. #3
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Zen Cart Counter History Time Off

    Not really on topic, but this should IMO be an admin setting.
    Quote Originally Posted by lat9 View Post
    Sounds like you need to edit /includes/extra_configures/set_time_zone.php to match your (rather than your webhost's) time-zone:
    Code:
    <?php
    /**
     * @package initSystem
     * @copyright Copyright 2003-2018 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: Drbyte Tue Sep 11 15:54:43 2018 -0400 Modified in v1.5.6 $
     */
    /*
     * Set time zone
    */
      // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
      $TZ = '';  // eg: 'Europe/Oslo'
    
    
    
      /**
       * MAKE NO CHANGES BELOW THIS LINE
       *
       * The following will take the timezone you specified above and apply it in your store.
       * If you didn't specify one, it will try to use the setting from your server's PHP configuration
       */
      if ($TZ == '') {
        $TZ = date_default_timezone_get();
      }
      if ($TZ != '') {
        putenv('TZ=' . $TZ);
        @date_default_timezone_set($TZ);
      }
    Follow the link just above the $TZ = ''; line to find the value that you'll need to set the cart's time to yours. Setting it in that one file will cause that time-zone to be used for the admin and the storefront.

  4. #4
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,009
    Plugin Contributions
    61

    Default Re: Zen Cart Counter History Time Off

    Yes, setting the server time would also resolve this. Lat was explaining how to do it manually in your Zen Cart is all.

    ~Melanie
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Zen Cart Counter History Time Off

    Unfortunately, having that as a database setting would be "too late", since there's start-up processing that requires that the time-zone be set prior to the database initialization.

  6. #6
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Zen Cart Counter History Time Off

    that's true, so maybe a value in the config file, that is set during installation? You would normally only set it once, and maybe on a server change. (that's how osc, and some other carts do it)

    Quote Originally Posted by lat9 View Post
    Unfortunately, having that as a database setting would be "too late", since there's start-up processing that requires that the time-zone be set prior to the database initialization.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Zen Cart Counter History Time Off

    Quote Originally Posted by Design75 View Post
    that's true, so maybe a value in the config file, that is set during installation? You would normally only set it once, and maybe on a server change. (that's how osc, and some other carts do it)
    Hmm, good idea! Right now, per your point, there are settings like that "sprinkled" in multiple files ... making it more time-consuming to get a site properly configured.

    The only 'issue' I see with that approach is that it could be possible to get the admin and storefront out-of-sync with that setting in both configure.php files. Right now, the admin's version of the time-zone setting pulls in that set on the storefront.

  8. #8
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Zen Cart Counter History Time Off

    Quote Originally Posted by lat9 View Post
    Hmm, good idea! Right now, per your point, there are settings like that "sprinkled" in multiple files ... making it more time-consuming to get a site properly configured.

    The only 'issue' I see with that approach is that it could be possible to get the admin and storefront out-of-sync with that setting in both configure.php files. Right now, the admin's version of the time-zone setting pulls in that set on the storefront.
    That may be a problem with the current versions of Zen Cart, but the dev version on github only has 1 configure file. I'll give it some thought, but right now I am trying to update the Super Orders plugin.

 

 

Similar Threads

  1. Counter History
    By valerie6128 in forum General Questions
    Replies: 4
    Last Post: 28 Jun 2011, 05:55 PM
  2. Counter History
    By wwwursa in forum General Questions
    Replies: 5
    Last Post: 19 Oct 2010, 03:11 PM
  3. Counter History
    By aphro6677 in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 3 Mar 2010, 01:49 PM
  4. counter history?!
    By procella in forum General Questions
    Replies: 2
    Last Post: 21 Nov 2008, 09:01 AM
  5. Counter History
    By windrising in forum General Questions
    Replies: 8
    Last Post: 16 Jun 2006, 10:25 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR