Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2020
    Location
    Florida
    Posts
    35
    Plugin Contributions
    0

    Default Stop purchase of only some products after daytime

    So I need to test for products in the shopping cart that have a daytime buying parameter? So, I need to add a time limit during the day for some products so that they cannot buy those products after hours. Does Zen cart have the ability to stop orders of only certain products in the shopping cart? Without shutting down the entire store like this plugin.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,703
    Plugin Contributions
    123

    Default Re: Stop purchase of only some products after daytime

    You'd have to custom code this; nothing is built in.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Oct 2020
    Location
    Florida
    Posts
    35
    Plugin Contributions
    0

    Default Re: Stop purchase of only some products after daytime

    Yes, I am asking how/where I would make this.

  4. #4
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Stop purchase of only some products after daytime

    Quote Originally Posted by Famine_1 View Post
    Yes, I am asking how/where I would make this.
    You would have to build an extra cart action script... includes/extra_cart_actions/SOMENAME_extra_cart_actions.php

    Doesn't mater what you name it as long as it's in that folder. For ideas/samples you can look at Download Already Purchased mod or Restrict Digital Downloads mod, both good mods by lat9..

    I do it on auctions both for loading the cart and for removing an item from the cart.. as a sample...
    Code:
    <?php
    /**
     * Product type Auction and Offer shopping cart remove action rewrite
     *
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V3.0
     * @Version $id: Product Type Auction and Offer 2  1 2010-06-20 10:30:40Z davewest $
     */
    
     //remove the existing item
    if (($_GET['action'] == 'remove_product')) {
      $product_id = ($_GET['product_id']);
      //die('offer product '. '-'.($_GET['product_id']));
      $type_check = $db->Execute("select products_type from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
      $auction = $db->Execute("select type_id from " . TABLE_PRODUCT_TYPES . " where type_handler = 'product_auction' ");
      
    if ($auction->fields['type_id'] == $type_check->fields['products_type']) {
        //reset auction price
        $auction_bid = $db->Execute("select bid_id, customers_bid from  " . TABLE_PRODUCTS_AUCTION . " where products_id = '" . (int)$product_id . "' order by bid_id DESC limit 1");
        $start_price = $db->Execute("select bid_start_price from  " . TABLE_PRODUCT_AUCTION_EXTRA . " where products_id = '" . (int)$product_id . "' limit 1");    
        $auction_current_price = ($auction_bid->fields['customers_bid'] >= 1) ? $auction_bid->fields['customers_bid'] : $start_price->fields['bid_start_price'];
         // update the product price in the PRODUCTS table to be the correct price
        $sql = "update " . TABLE_PRODUCTS . " set products_price = '" .  $auction_current_price  . "' where products_id = '" . (int)$product_id  . "'  LIMIT 1 ";
        $db->Execute($sql); 
        $_SESSION['cart']->actionRemoveProduct($goto, $parameters);
      } else {
        //not auction or offer products go as before
        $_SESSION['cart']->actionRemoveProduct($goto, $parameters);
        }
      }
    auto remove would be interesting when you consider time! are you talking about GMT, PST, EST MST... then throw in daylight savings, then winter and summer solstice...
    Dave
    Always forward thinking... Lost my mind!

  5. #5
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,154
    Plugin Contributions
    11

    Default Re: Stop purchase of only some products after daytime

    You could base it on the difference from the client's timezone BUT, that is often done by IP which can be a VPN for Singapore used by someone in Atlanta.

    Interesting situation.

 

 

Similar Threads

  1. v154 URGENT, No purchase record after customer purchase
    By lcc93611 in forum General Questions
    Replies: 3
    Last Post: 9 Jan 2016, 11:33 PM
  2. Allow download ONLY after purchase
    By robsnowden in forum General Questions
    Replies: 0
    Last Post: 29 Jan 2009, 02:11 PM
  3. Possible to add some products without purchase option?
    By squire11 in forum General Questions
    Replies: 1
    Last Post: 21 Feb 2008, 02:18 PM
  4. Can I make some products ship-only, some pickup-only, some both?
    By TheToe in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 7 Nov 2006, 12:33 AM
  5. Only allow ordering of SOME products
    By deejmer in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 Aug 2006, 08:17 PM

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