Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    34
    Plugin Contributions
    0

    help question Limit Products in Store

    Hi

    I am looking at limiting the number of products a store owner can have in his store.

    the basic package would be 100 products if he wants more then he would need to upgrade to the next package

    this was asked some time back ( http://www.zen-cart.com/forum/showthread.php?t=100031 ) but next got an answer

    hoping someone has a solution

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Limit Products in Store

    What was asked for in that other thread would be a very clear breach of the GPL license under which Zen Cart is distributed, and contrary to the spirit of open source within which Zen Cart is developed.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Aug 2009
    Posts
    34
    Plugin Contributions
    0

    help question Re: Limit Products in Store

    Thanks for response

    So what do web designers/developers do when they want to limit the number of products a store owner has in their store and want to have a package with 0-100 products 0-1000 products and 1000 products +

    a greater number of products = more storage and potentially more traffic.

    please excuse our ignorance

    thanks in advance

  4. #4
    Join Date
    Aug 2009
    Posts
    34
    Plugin Contributions
    0

    Default Re: Limit Products in Store

    hi found a solution and for education purposes the following info is provided

    modify products.php by adding the function (number of products in store is limited to 100)

    Code:
    function products_allowed(){
    
    global $db;
    global $product_limit;
    $product_limit = 100;
    
      $products = $db->Execute("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");
      if ($products->fields['count'] >= $product_limit){return 'true';}
    return 'false';
    }

    add the following case statments

    Code:
         case 'new_product':
    if (products_allowed() == 'true') header("location: product_limit_denied.php");
          break;
    
          case 'insert_product':
    if (products_allowed() == 'true') header("location: product_limit_denied.php");
    	break;
    then use the file denied.php from admin profiles module , in this example I renamed the file to product_limit_denied.php

    this is for educational purposes and is not supported or guaranteed to work.

 

 

Similar Threads

  1. Limit Products by State
    By townsend2009 in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 14 Oct 2009, 05:03 PM
  2. Limit # of products in boxes
    By crosswithyou in forum Basic Configuration
    Replies: 5
    Last Post: 4 Jan 2009, 01:02 AM
  3. Limit products or categories
    By dscott1966 in forum Basic Configuration
    Replies: 3
    Last Post: 10 Jun 2008, 01:44 AM
  4. limit products to groups
    By billt in forum General Questions
    Replies: 0
    Last Post: 26 May 2008, 04:39 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