Thanks for your answer.
I try and it came error message.
ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?
Thanks for your answer.
I try and it came error message.
ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?
I just need basic script, open-closed shop auto whit cron job. I found store_status.php script from zen cart forum. And i can't update version.
and i four this otter subject of zen cart forum...
Dr Byte's solution works well for me but I thought I'd add a little caveat which might save somebody some time.
If you run your php program directly as a cron job it won't have the right working directory and won't find /includes/config.php so it will fail with;
ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?
To avoid this you need to tell cron to change directory before invoking PHP to run the program, so your cron command should read
Code:
cd "public_html/admin"; /usr/local/bin/php my_program.php
Remember to leave a space between your path to PHP and the program name, you are invoking PHP with the program name as a parameter.
I hope this helps someone.
require('includes/application_top.php'); this file loads the paths needed for configure.php
For testing uncomment the echo commands.
Then call the script www.xxxxxx/adminxxx/store_status.php
After you get the script to work then setup the cron up.
Skip
• 446F63746F722057686F •
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:
If you wanted store status = 2 then you would need to setPHP 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
}
PHP Code:$zen_store_stat = 2; // Store is Closed Showcase with prices
It doesn't change store status open (0), with all combination.![]()
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;
}
You know this work.
Thanks
![]()