Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Oct 2007
    Posts
    132
    Plugin Contributions
    0

    Default add to cart only during physical store operating hours?

    Is there a way to allow the add-to-cart only during store hours?

    This is for online ordering for a restaurant. Do not want people sending order if the store is closed.

    Thanks,
    Jeff

  2. #2
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: add to cart only during physical store operating hours?

    You can certainly write/or hire someone to write a simple cronjob to do that. The job just have to change the store mode to view price only when it closes, and change back to normal when it opens. Or you can do it manually.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  3. #3
    Join Date
    Oct 2007
    Posts
    132
    Plugin Contributions
    0

    Default Re: add to cart only during physical store operating hours?

    Thanks for the reply.

    After reading about cron jobs, it seems they run at a set time.

    Would it work if a code was added to index.php (I think that's where it is needed) that would do the date/time checks and set "STORE_STATUS" for the current session?

    I think the answer to my question depends on whether STORE_STATUS is set once or if it is read from the database multiple times? If read once, my logic says this will work. If read multiple times, the program would need to update the table. This leads to the question of if I am correct that index.php would always be executed upon entering the site preventing someone from getting an incorrect status?

    Sorry I took so long to respond. I missed your reply somehow.

    Jeff

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: add to cart only during physical store operating hours?

    What if someone is online for an hour before your restaurant closes, and orders after that?
    The check really needs to happen when an order is placed, and possibly also when the add to cart is clicked.

  5. #5
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: add to cart only during physical store operating hours?

    I dont understand why you dont like the idea of having cronjob running at certain time. It seems to help you with your requirement. Or is there any I'm missing?
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  6. #6
    Join Date
    Oct 2007
    Posts
    132
    Plugin Contributions
    0

    Default Re: add to cart only during physical store operating hours?

    yellow1912,

    The site will potentially host hundreds of restaurants, each a separate ZC install on a single server. My thought process was that it might be easier to just have a single mod on each site that checked a store hours table (one table created for each store).

    After giving more thought to your suggestion, I do like your idea. I'm sure the routine could run every half hour and check if any stores need to be updated. That makes sense.

    gjh42,

    Good question! I'm going to have to test this. I'll see what happens if I change the store status after beginning order entry.

    Thanks to all. I really appreciate the help.

  7. #7
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: add to cart only during physical store operating hours?

    have the store flip on down for maintenance manually every night just like they were closing the store doors....

    and you can easily change teh DFM page to read

    Closed Store Hours are
    Zen cart PCI compliant Hosting

  8. #8
    Join Date
    Oct 2008
    Posts
    5
    Plugin Contributions
    1

    Idea or Suggestion Re: add to cart only during physical store operating hours?

    I am also looking to be able to do this.

    The problem with pulling the site down for maintenance is that I want customers to be able to see the menu (Online food ordering) and browse while the physical store is closed. However, when they try to put something into the cart or try to check out it would redirect them to a page stating the opening hours.

    So far I reckon the best way to do this is via the observer class
    http://www.zen-cart.com/wiki/index.p..._API_Tutorials
    Once the customer adds something to the cart or tries to check out, it would run my code.

    PHP Code:
    function storeStatus() {
        
    $_SESSION['cart']->attach($this, array('NOTIFIER_CART_ADD_CART_END''NOTIFY_CHECKOUT_PROCESS_BEGIN'));
      } 
    But heres my problem, how do I create a global variable ie ($STORE_STATUS) which can be set via a short php script, and how do I get it to redirect to my store openning hours page?

    Any help of either of those issue please!!

  9. #9
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: add to cart only during physical store operating hours?

    my 2 cents
    I have been watching this time setting option.

    I agree that a cron approach is the best way to activate the change.

    Write a small script that changes the STORE_STATUS value of the DB and insert into the configuration table.

    open_shop cron insert 0= Normal Store
    close_shop cron insert 2= Showcase with prices

    With this approach it can be out side zen-cart code or write it into the admin as a mod.

    Just a suggestion.
    • 446F63746F722057686F •

  10. #10
    Join Date
    Oct 2007
    Posts
    132
    Plugin Contributions
    0

    Default Re: add to cart only during physical store operating hours?

    NeoNexus,

    STORE_STATUS is available, but I'm not sure if it's changed anywhere once you enter the store. I have not gotten that far yet. (I would think it is never changed in core code.)

    As my developement & testing continues, I see areas where the cron job would not help in every situation. In my earlier reply to Yellow1912, I knew in the back of my mind I would probably need more than the cron job, but it was too soon to know the full extent of what would be needed.

    Using a cron job & changing store status to showroom after closing is a starting point. As NeoNexus said, maint is not desired because we also want people to browse after hours.

    The problem comes with delivery hours vs. ordering hours vs. store hours. Store closes at 11:00, delivery till 10:00, accept pickup orders till 10:30.

    The logic for this will likely be what's needed to deal with lunch specials. (Price/item only good till 3:00pm kind of thing.)

    In the month since I first posted, I have gained a lot more insight into php and ZC and I think NeoNexus might be heading in the right direction. As most long time developers, I of course did not RTFM. I guess it's time now.

    As I see now that others have an interest, I will post back when I find a solution.

    Thanks for all the suggestions,
    Jeff
    Last edited by Jeff G; 3 Oct 2008 at 03:37 AM.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Any Zen Cart users operating out of New Jersey?
    By tomzc in forum General Questions
    Replies: 0
    Last Post: 20 Jun 2008, 08:00 PM
  2. Store Hours
    By brycej2 in forum Basic Configuration
    Replies: 5
    Last Post: 8 Mar 2007, 10:05 PM
  3. Changing Store's Physical Address
    By AngelStorm in forum Basic Configuration
    Replies: 2
    Last Post: 20 Oct 2006, 02:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR