If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Customization from the Admin / Scheduled posts' availability / Make public on a certain date

Scheduled posts' availability / Make public on a certain date

Started by honatto on 12 Aug 2018, 12:41 PM · Views: 10,819

Results 1 to 4 of 4
12 Aug 2018, 12:41 PM
#1
honatto avatar

honatto

New Zenner

Join Date:
Jun 2018
Posts:
11
Plugin Contributions:
0

Post #1 by honatto

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.

12 Aug 2018, 12:56 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,144
Plugin Contributions:
56

Post #2 by lat9

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?

12 Aug 2018, 1:32 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #3 by mc12345678

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.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

11 Nov 2018, 1:30 AM
#4
honatto avatar

honatto

New Zenner

Join Date:
Jun 2018
Posts:
11
Plugin Contributions:
0

Post #4 by honatto

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.