Thread: Cron Job

Results 1 to 10 of 20

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Cron Job

    Quote Originally Posted by Cenkki View Post
    fortunately it works.
    wget -O - www.xxxxxx/xxxxx/adminxxx/store_status.php
    add... define('CRON_ADMIN_USER_ID', '1');

    but :)

    if store status 2= Showcase with prices, it change 1= Showcase no prices
    if store status 0= Normal Store, its change 1= Showcase no prices again
    if store status 1= Showcase no prices, its not changing
    That indicates that the script is working as per configuration:

    PHP Code:
    if ((date(H) >= $store_open) && (date(H) <= $store_close)) {
    $zen_store_stat 0// Store is Open Normal Zen Cart
    } else {
    $zen_store_stat 1// Store is Closed Showcase no Prices

    If you wanted store status = 2 then you would need to set

    PHP Code:
    $zen_store_stat 2// Store is Closed Showcase with prices 

  2. #2
    Join Date
    Sep 2010
    Location
    Finland
    Posts
    59
    Plugin Contributions
    0

    Default Re: Cron Job

    It doesn't change store status open (0), with all combination.

  3. #3
    Join Date
    Sep 2010
    Location
    Finland
    Posts
    59
    Plugin Contributions
    0

    Default Re: Cron Job

    I forget add that code also...

    admin/init_includes/init_admin_auth.php

    if (!isset($_SESSION['admin_id']) && defined('CRON_ADMIN_USER_ID') && (int)CRON_ADMIN_USER_ID != 0) {
    $_SESSION['admin_id'] = CRON_ADMIN_USER_ID;
    }

  4. #4
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Cron Job

    Quote Originally Posted by Cenkki View Post
    It doesn't change store status open (0), with all combination.
    Played with this on a local install. I changed

    PHP Code:
    if ((date(H) >= $store_open) && (date(H) <= $store_close)) { 
    to

    PHP Code:
    if ((date('H:i:s') >= $store_open) && (date('H:i:s') <= $store_close)) { 
    and it appears to work

  5. #5
    Join Date
    Sep 2010
    Location
    Finland
    Posts
    59
    Plugin Contributions
    0

    Default Re: Cron Job

    You know this work.
    Thanks

  6. #6
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Cron Job

    Quote Originally Posted by Cenkki View Post
    You know this work.
    Thanks
    Good to see that you got this working for you now.

    Cheers / Frank

  7. #7
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    71
    Plugin Contributions
    0

    Default Re: Cron Job

    Hello,

    The described solution works, but I found out, it causes the following PHP Warning (in case the sctipt is being executed by cron, not from Admin):

    PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib64/php:/usr/share/pear') in /.../admin/includes/init_includes/init_languages.php on line 38
    Here is the appropriate part of init_languages.php (strings 34...39):

    Code:
    // include the language translations
      require(DIR_WS_LANGUAGES . $_SESSION['language'] . '.php');
      $current_page = basename($PHP_SELF);
      if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $current_page)) {
        include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $current_page);
      }
    I have found out, the $SERVER['PHP_SELF'] is an empty string (in case the script is being executed by cron!), thus $current_page is also empty.

    How such issue can be fixed?

    Thank you in advance and best regards,

    AR

  8. #8
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Cron Job

    Quote Originally Posted by yesaul View Post
    Hello,

    The described solution works, but I found out, it causes the following PHP Warning (in case the sctipt is being executed by cron, not from Admin):



    Here is the appropriate part of init_languages.php (strings 34...39):

    Code:
    // include the language translations
      require(DIR_WS_LANGUAGES . $_SESSION['language'] . '.php');
      $current_page = basename($PHP_SELF);
      if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $current_page)) {
        include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $current_page);
      }
    I have found out, the $SERVER['PHP_SELF'] is an empty string (in case the script is being executed by cron!), thus $current_page is also empty.

    How such issue can be fixed?

    Thank you in advance and best regards,

    AR
    Take a look at this plugin - created after reading through this thread.

    Cheers / Frank

  9. #9
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Cron Job

    Quote Originally Posted by yesaul View Post
    ......
    The described solution works, but I found out, it causes the following PHP Warning (in case the sctipt is being executed by cron, not from Admin):...
    Considering your installation works when the script is executed from admin, take a look at the readme.html file contained in the ASOC plugin. The 'Configuration' tab in that file says:

    Configuration


    1. Login to your cPanel (or similar installation)
    2. Go to Cron TabsCreate 2 new cron jobs and enter these configurations (or equivalent)

      These times need to be adjusted to reflect your actual opening closing times.
    Do you still get the error when you use the suggested lines in the cron tab?
    Last edited by frank18; 7 Sep 2014 at 12:29 AM.

 

 

Similar Threads

  1. v154 Cron job coding
    By droidmcse in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 24 Apr 2015, 11:29 PM
  2. Cron Job to enable a EZ Page?
    By cs_jono in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Jun 2010, 08:20 PM
  3. CRON job help
    By Jeff G in forum General Questions
    Replies: 10
    Last Post: 9 Oct 2008, 12:20 AM
  4. zen_mail as part of a cron job...
    By savage in forum General Questions
    Replies: 0
    Last Post: 30 Nov 2007, 06:25 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