I did not succeed cron job with store_status.php. Can any one help?
command: php /home/xxxxx/public_html/xxxxxx/adminxxx/store_status.php
store_status.php
<?php
/*
***********************************************************************
$Id: store_status.php, v 1.0 2010/05/26
ZenCart 1.3.x > 1.3.9c
Copyright 2003-2010 Zen Cart Development Team
Portions Copyright 2004 osCommerce
http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
Written By SkipWater <[email protected]> 05.08.10
Use at your own risk.
***********************************************************************
All we do is set the store status value based on the time of day.
The admin of the zen cart should setup a cron to run this script a
minute or two after the hour set to open and close the store.
That is 2 (two) cron calls a day. One to open and one to close.
This file must be run from the admin folder of the zen cart site.
*/
require('includes/application_top.php');
// Change to meet your opening and closing times
// Time is based on 24 hour clock 12 = noon 24 = Midnight
$store_open = ('21:53:00');// 12:00 noon
$store_close = ('21:34:00'); // 10:00 pm
// If you want an email sent to store owner, that notifies the Online Store Is Now OPEN
// Set this to 1
$notify = 1;
/*
0 = Normal Store
1 = Showcase no prices
2 = Showcase with prices
*/
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
}
// Should not need to edit below this line
// ***********************************************************************
$check_query = "SELECT * FROM " . DB_PREFIX . "configuration WHERE configuration_key = 'STORE_STATUS';";
$check_result = $db->Execute($check_query);
if ($check_result->RecordCount() > 0) {
$insert_query = "UPDATE " . DB_PREFIX . "configuration SET configuration_value = '".$zen_store_stat."' WHERE `configuration_key` = 'STORE_STATUS'; ";
$insert_result = $db->Execute($insert_query);
// uncomment if not running cron
// if ($insert_result) echo 'Store Status Set to '.$zen_store_stat.'<br />';
if ($notify != 0) {
zen_mail('',STORE_OWNER_EMAIL_ADDRESS, 'Store Status Changed to OPEN', 'OnLine Store OPENED '. date('M, d Y H:i'), '',STORE_OWNER_EMAIL_ADDRESS); // email admin if status change to OPEN
}
} else {
// uncomment if not running cron
// echo 'Error Setting Store Status <br />';
zen_mail('',STORE_OWNER_EMAIL_ADDRESS, 'Error Failed Setting Store Status', 'ERROR Failed to OPEN OnLine Store'.date('M, d Y H:i'),'',STORE_OWNER_EMAIL_ADDRESS); // email admin if status change failed
}
?>
message:
Status: 302 Moved Temporarily
X-Powered-By: PHP/5.4.29
Set-Cookie: zenAdminID=6a659ab870d8cdee1bc7ad50ee383170; domain=.xxxxxx; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Location: http://xxxxxx/login.php?camefrom=&/h...c7ad50ee383170


Reply With Quote

