Scheduled posts' availability / Make public on a certain date
Greetings,
I was wondering for some time if it is possible to do the follow thing within the admin panel, being helped by plugins or whatsoever. I usually prepare news/products and I want them to publish on the next day at 0:00 AM. How does that one get to do that within Zen Cart? I guess I can create a custom php file with the help of CRON, too. But I was wondering if there is such a thing existing already.
Simple:
1) Prepare a publication/product.
2) Submit it as not available (OFF) and choose a time and/or time to be switched to available (ON).
3) When the right time comes, it becomes available to the public and the date it displays as added is the current date, not when prepared.
Advanced:
Might be done with the help of .php script, database columns (don't really know the structure of ZC) and CRON jobs.
Thanks in advance! Looking forward to hearing your ideas.
Re: Scheduled posts' availability / Make public on a certain date
For each product's definition, there's a Date Available entry which, if not empty, identifies the date on which which the product is automatically made available at midnight.
What plugin are you using for the news?
Re: Scheduled posts' availability / Make public on a certain date
And then as far as the "date-added" information, that is a separate field that can be accessed with a sql statement or by adding the field to be displayed; however, is by default set with the information of when it was added/created.
Re: Scheduled posts' availability / Make public on a certain date
I managed to do it myself:
1) I added additional fields when creating "news" with document_general - enable delayed display and date for enabled display (YYYY-MM-DD HH-MM-SS)
2) Created additional two db fields - "products_cron" with value 0 and 1, as if it was "enable delayed display" - ON and OFF, "products_cron_date" which is a field similar to products_date_modified and products_date_available.
3) Edited and updated the files needed to make the connection between the php files and db update.
4) Create a "crone php file" which updates products which meet the criteria of products with status off, products_cron = 1 TO status = 1, products_cron = 0, products_date_added = products_cron_date (current server time)
5) Created a cron job which runs the php file from step. 4 at midnight.