Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    419
    Plugin Contributions
    0

    Default How to make one category password protected?

    One of our categories is a Wholesale area ...

    How do we make this password protected so only those who buy wholesale from the site can login ?

  2. #2
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: How to make one category password protected?

    This is not really going to be plausible in this way.... However, in the past people have used the group pricing plugin to have regular shoppers see no prices and approved vendor see their prices.

    or create a whole new store on a subdomain and require login, but setting store to approved shoppers only and making your login the main page.

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  3. #3
    cpmac Guest

    Default Re: How to make one category password protected?

    I've been toying with this idea.
    I have the idea of adding a password field to categories.
    In the product_info.php page add the password field to the mysql select, then if field is not null ask for password.
    I wonder if adding new variables to scripts will break zencart.

  4. #4
    Join Date
    Jun 2007
    Posts
    89
    Plugin Contributions
    0

    Default Re: How to make one category password protected?

    Take a look at the "Dual Pricing" module. This lets you set wholesale prices to existing products that are only seen by those clients permitted to see them. So if a client is an authorised wholesale customer, then the wholesale price of the product is displayed. Various levels can be set to account for what price you give different sets of clients, i.e. you can set different levels of wholesale prices.

  5. #5
    cpmac Guest

    Default Re: How to make one category password protected?

    Hiding prices isn't the problem, it's hiding the viewing of products.

    I've had a go at this problem; I've allready got it to work in OsCommerce but with the different file structure in zencart i'ts not working. If any one can see the flaw in my syntax or reasoning.

    I'm using
    Zen Cart 1.3.8a
    Patch: 1::
    Version de la Base de Données: 1.3.8




    In brief, I added a pass word field PW to categories.
    I modifed includes/functions/function_categories.php
    added files entry-form.php and pass-good.php

    the script is failing at the query I'm getting "No row" message.
    although the query works in a separate file with the variables predefined.

    The query works when I put it in a stand alone php script with the variables provided, but not in Zencart.

    I have five categories set up and one has an entry in the PW field.


    the modifictation to function_categories.php

    after return 'cPath=' . $cPath_new;
    }
    line 55

    Code:
    Code:
    /* check for pass word and cookie */
              $query = "select PW   from categories  where categories_id = '" . (int)$current_category_id . "'";
          $result = mysql_query($query) ;
          if (!$result)
            {
            die('No result: ' . mysql_error());
      }
          $row  = mysql_fetch_array($result)  ;  
          if (!$row)
            {
            die('No row: ' . mysql_error());
      }
          
              $mot_pass=$row["PW"];
         
         $go ="YES";
         
         if(isset($_COOKIE["look"]) && $_COOKIE["look"]==$mot_pass)
             {
             $go="YES";
             }
             
             if($mot_pass !=NULL && !isset($_COOKIE["look"]))
             {
             $go="NO";
             }
             
             
             if ($go=="NO")
            {
            include('entry_form.php');
        }
    the file entry_form.php

    Code:

    Code:
    <td>
    enter the password for this section<BR>
    <BR>
    <form method="POST" action="pass_good.php">
    <INPUT TYPE="text" NAME="given_word" VALUE="">
    <INPUT TYPE="hidden" NAME="pass_word" VALUE=<?php echo $mot_pass; ?>>
    <button type="submit" name="submit">Submit</button>
    </td>
    the file pass_good.php

    Code:

    Code:
    <?php 
    $given_word = $_POST['given_word'];
    $mot_pass=$_POST['pass_word'];
    switch ($mot_pass) 
    {
        case "vague":
            if ($given_word == "vague")
    		{
    		setcookie("look", "vague", time()+360000);
    		}else{
    		$mot_pass="wrong";
    	}
            break;
         default:
           $mot_pass="wrong";
    }
    
    ?>
    <html>
    
    <body>
    <?php
    
    echo $given_word . "<BR>";
    echo $mot_pass ."<BR>";
    ?>
    <a href="javascript:history.go(-1)">Continuer</a>
    </body>
    </html>

  6. #6
    cpmac Guest

    Default Re: How to make one category password protected?

    I've finally cracked the problem. I modified a different file.
    http://www.zen-cart.com/forum/showthread.php?t=132978

 

 

Similar Threads

  1. Replies: 1
    Last Post: 8 Oct 2011, 06:05 PM
  2. Password protected store: how to move new customer sign up to different page?
    By AdaLovelace in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Apr 2011, 11:26 AM
  3. How do I create password protected pages?
    By wondernate in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Jun 2010, 02:48 AM
  4. Can I make (free) product video clips password protected?
    By mccawphoto in forum General Questions
    Replies: 0
    Last Post: 8 Jan 2009, 07:24 PM
  5. Make a password protected zencart entrance
    By pensandpencils in forum General Questions
    Replies: 7
    Last Post: 10 Jul 2008, 07:07 PM

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