Auto Store Open/Close (ASOC) v1.0 for Zen Cart v1.5.x


Purpose & Aim

This plugin is intended for a Fast Food / Pizza etc bricks & mortar shop with online ordering facility.

It enables the store owner to automatically open or close the online store depending on the actual opening hours of the physical store.

As an example, a pizza shop offers home delivery and/or pre-ordering online. The physical store operates from say 10.00 to 23.00 hrs. Last orders are taken at 22.30 hrs. Therefore the store owner does not want to see any online orders after the kitchen closes - or the customer would be mighty unhappy.....

A few cron jobs and 2 files added to the admin section automatically opens and closes the online store by changing the store status to 'Showcase with prices' or 'Showcase - no prices' (selecting the former would make sense...).

The store owner receives an email once the online store status has changed.

If the physical store operates the same hours every day of the week then only 2 cron tabs need to be set, one for open and one for close. If the hours vary for certain weekdays then additional cron tabs need to be set - depending on the owner's requirements.

It is recommended that the user also installs the module Product Delivery by Postcode (PDP) to ensure that vistors from a far away residence can not place an order. You would not want to take money from someone who lives in Adelaide if your store is located in Melbourne or Sydney only because the customer lives in a suburb with a name that exists in all 3 cities (eg Cheltenham) and does not notice that the online store is attached to a physical store which is not in his/her city - makes sense???

The support thread for ASOC can be found here.

This plugin has been designed for a ZC 1.5.x installation. It is possible that it MAY work as desired on ZC installations prior to 1.5.x
- TEST and use with CAUTION!

!! READ EVERYTHING !!

After following the installation instructions, it is strongly recommended that you read through the ENTIRE "Configuration" & "Functionality" sections of this readme. There you will find out exactly what ASOC can do.

Ready to get started? Just follow the installation instructions.

Installation

!!!!! BACKUP YOUR FILES AND DATABASE BEFORE YOU BEGIN !!!!!

BEFORE INSTALLING, you are strongly encouraged to READ ALL OF THE TABS in this readme file. Then follow the installation or upgrade instructions, as appropriate.

BEFORE YOU POST A QUESTION ON THE FORUM - read through this readme again as needed

There are two (2) folders in the package

  • 1_readme_docs
  • 2_install_Files
New Installation Instructions

Follow these instructions step by step in the listed order!

  1. BACK UP your database & store! (You have been told..)
  2. Unzip the ASOC package to a temp folder on your local hard drive, retaining the folder structure.
  3. Open the file 2_install_files/YOUR_ADMIN/auto_store_open_close.php in your favourite editor
  4. Edit the lines

    $store_open = ('08:55:00');// 08:55 am

    $store_close = ('22:25:00'); // 10:25 pm

    and replace 08:55:00 and 22:25:00 with the times of your physical store

  5. Rename the folder "YOUR_ADMIN" in the "2_Install_Files" folder to match the name of your admin folder.
  6. Upload the enclosed files to your online store
  7. You are now ready to configure your cron tabs

Upgrade Instructions

-- NONE --


Un-Install Instructions
  1. BACK UP your database & store to a separate folder (just in case!)
  2. Delete the relevant cron tabs in your server admin (eg cPanel)
  3. Delete the 2 files included in your installation package
DONE

Configuration

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

      00 9 * * * wget http://yourdomain.com/YOUR_ADMIN/auto_store_open_close.php >/dev/null 2>&1

      30 22 * * * wget http://yourdomain.com/YOUR_ADMIN/auto_store_open_close.php >/dev/null 2>&1

    These times need to be adjusted to reflect your actual opening closing times.


This example assumes that your store opens at 09.00 (9am) and closes at 22.30 (10.30pm) every day of every week

If your operating hours vary from day to day then you need to create separate cron tabs for every day - one tab for every 'open/close' per day

Credits & History

Author: Frank Riegel (frank18) - http://isonetwork.net.au

(inspired and based on a script by SkipWater 05.08.10)

  • Version 1.0 released July 2014

Change Log

-- none at this stage --

Troubleshooting

Basics

BEFORE you post your 'issue' in the support thread:

If ASOC does not work or gives you errors:

  • Make sure all files are in the correct location
  • Make sure you uploaded ALL the ASOC files
  • Make sure the files are not corrupted by bad FTP transfers
  • RE-READ THE INSTALLATION AND CONFIGURATION TABS CONTAINED IN THIS README !!!

Please Note:

There are NO modifications to core Zen Cart files!

New Files (2)

YOUR_ADMIN/auto_store_open_close.php

YOUR_ADMIN/includes/init_includes/overrides/init_cron_admin_user_id.php

MISC

If you are happy with this mod you are cordially invited to make a small donation (PayPal to service@frnt.org) towards the power consumption of my computer which has helped me to make this contribution workable.

Other than that: Enjoy!

Cheers from frank18

LICENSE

PDP is released under the General Public License (see LICENSE.txt)

This script is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Always backup your shop and database before making changes.