Catalog page visible to wholesalers only

If a client wants to keep the catalog page hidden to anyone who is not a wholesale vendor, you can use this easy mod to send them back to the wholesale login page until they log in.

  1. Open the openinfo.php page in the /enc/ folder.

  2. Find the lines:

    // Set review link
    $View_Page = "http://" .$Mals_Server .".aitsafe.com/cf/review.cfm";
    
  3. Just above those lines, add the code:

    // START MODIFICATION - RESET IF NOT LOGGED IN
    if ($setpg == $catpg AND empty($dirname) AND (empty($wspass) OR empty($wsemail) OR $wsnum != 1))
    {
    header("location: " .$URL ."/wholesale." .$pageext);
    }
    // END MODIFICATION - RESET IF NOT LOGGED IN

    and save the file.

Alternate Option - To return the customer back to the wholesale page if any page other than the wholesale page (and not just the catalog page!) is selected, use the following:

  1. Open the openinfo.php page in the /enc/ folder.

  2. Find the lines:

    // Set review link
    $View_Page = "http://" .$Mals_Server .".aitsafe.com/cf/review.cfm";
    
  3. Just above those lines, add the code:

    // START MODIFICATION - RESET IF NOT LOGGED IN
    if ($setpg != "wholesale." .$pageext AND empty($dirname) AND (empty($wspass) OR empty($wsemail) OR $wsnum != 1))
    {
    header("location: " .$URL ."/wholesale." .$pageext);
    }
    // END MODIFICATION - RESET IF NOT LOGGED IN

    and save the file.

Important! If you use this second alternate option, there is a chance of a continual loop if you do not type the code in correctly. Please test thoroughly before allowing customers to use the site.