Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32
  1. #11
    Join Date
    Jul 2009
    Posts
    48
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    I've followed all the steps 3x.
    I am able to create password protected categories in the admin panel.
    I am able to add a product under that category
    When I visit the store and click on that category, I see the product. I am not prompted for a password.

    Any ideas?

  2. #12
    Join Date
    Jul 2009
    Posts
    48
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    Quote Originally Posted by robbinsgj View Post
    I've followed all the steps 3x.
    I am able to create password protected categories in the admin panel.
    I am able to add a product under that category
    When I visit the store and click on that category, I see the product. I am not prompted for a password.

    Any ideas?
    I fixed this by bypassing the override directories and just modifying the files.

    Additionally, the following instructions have the wrong lines in them:

    ------------------------------------------------------
    FILE: /includes/languages/english/CUSTOM/index.php

    Find (on or around line 48):

    define('TEXT_PRODUCT_MODEL', 'Model: ');

    Add the following lines underneath it:

    define('CATEGORY_PASS_INVALID', '<h4 style="color: #ff0000;">Invalid Password</h4>');
    define('CATEGORY_INSERT_PASSWORD', '<h3>Category Locked</h3><p>For security reasons, this category is password protected. If you haven\'t been given the password, then you are not authorized to view this category.</p><strong>Please enter the password</strong>: ');

    **Repeat this with any other languages you use.

    ------------------------------------------------------
    FILE: /includes/languages/english/CUSTOM/product_info.php

    Find (on or around line 20):

    define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

    Add the following lines underneath it:

    define('CATEGORY_PASS_INVALID', '<h4 style="color: #ff0000;">Invalid Password</h4>');
    define('CATEGORY_INSERT_PASSWORD', '<h3>Category Locked</h3><p>For security reasons, this category is password protected. If you haven\'t been given the password, then you are not authorized to view this category.</p><strong>Please enter the password</strong>: ');

    **Repeat this with any other languages you use.

    ----------------------------------------------------------

    define('TEXT_PRODUCT_MODEL', 'Model: '); is actually on line 20 in file /includes/languages/english/CUSTOM/product_info.php

    define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers'); is actually on line 48 of file /includes/languages/english/CUSTOM/index.php

  3. #13
    Join Date
    May 2008
    Posts
    203
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    I edited your text to reflect the changes you mention in page two. Can you update your zip with this text?


    Also, If you can explain WHICH occurrence of <!--bof Form close--> to place code under that would be great! There are two there.







    This installation includes editing 7 files, installing 1 new file, and applying one SQL patch (a fairly simple one).

    1. ADD FILES

    Add the file "tpl_category_pass_check.php" to /includes/templates/CUSTOM/templates

    ######################################################################
    2. INSTALL SQL PATCH

    BE SURE TO BACKUP YOUR DATABASE BEFORE PROCEEDING

    In the admin area, under "Tools -> Install SQL Patches", enter the following query:

    ALTER TABLE categories ADD pw varchar(64);

    WARNING! This assumes you have not used a prefix when installing your databases. If you did use a prefix, add it before "categories" (ie: prefix_categories)

    ######################################################################
    3. EDIT FILES

    If you don't understand the use of CUSTOM in some of the file paths, please read https://www.zen-cart.com/tutorials/index.php?article=36

    WARNING! Currently there is no override system for admin files, so some of these files listed are the CORE files. Always do a backup of each file before you edit it.

    --------------------------------------------------------------------
    FILE: /admin/includes/modules/category_product_listing.php

    Find (on or near lines 100 AND 109) There are TWO! Replace them both!:

    $categories = $db->Execute("select c.categories_id, cd.categories_name, cd.categories_description, c.categories_image,
    c.parent_id, c.sort_order, c.date_added, c.last_modified,
    c.categories_status

    Replace BOTH with:

    $categories = $db->Execute("select c.categories_id, cd.categories_name, cd.categories_description, c.categories_image,
    c.parent_id, c.sort_order, c.date_added, c.last_modified,
    c.categories_status, c.pw

    (Just added ", pw")

    -------------------------------------------------------
    FILE: /admin/categories.php

    Find (on or near line 147):

    if (isset($_POST['categories_id'])) $categories_id = zen_db_prepare_input($_POST['categories_id']);
    $sort_order = zen_db_prepare_input($_POST['sort_order']);

    $sql_data_array = array('sort_order' => (int)$sort_order);

    if ($action == 'insert_category') {
    $insert_sql_data = array('parent_id' => $current_category_id,
    'date_added' => 'now()');

    Replace with:

    if (isset($_POST['categories_id'])) $categories_id = zen_db_prepare_input($_POST['categories_id']);
    if (isset($_POST['categories_pw'])) $categories_pw = zen_db_prepare_input($_POST['categories_pw']);
    $sort_order = zen_db_prepare_input($_POST['sort_order']);

    $sql_data_array = array('sort_order' => (int)$sort_order);

    if ($action == 'insert_category') {
    $insert_sql_data = array('parent_id' => $current_category_id,
    'date_added' => 'now()',
    'pw' => $categories_pw);


    Find (on or near line 182):

    $update_sql_data = array('last_modified' => 'now()');

    Replace with:

    $update_sql_data = array('last_modified' => 'now()',
    'pw' => $categories_pw);


    Find (on or near line 704 AND 758) There are TWO! Replace them both!:

    } else {
    $category_inputs_string .= zen_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', zen_get_category_description($cInfo->categories_id, $languages[$i]['id']));
    }
    }

    Replace BOTH with:

    } else {
    $category_inputs_string .= zen_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', zen_get_category_description($cInfo->categories_id, $languages[$i]['id']));
    }
    $category_inputs_string .= "<br /><br />" . TEXT_CATEGORIES_PASSWORD . zen_draw_input_field('categories_pw', $cInfo->pw, '', false, 'text', true);
    }

    ----------------------------------------------------
    FILE: /admin/includes/languages/english/categories.php

    Find (on or near line 214):

    define('TEXT_CATEGORIES_DESCRIPTION', 'Categories Description:');

    Add the following line underneath it:

    define('TEXT_CATEGORIES_PASSWORD', '(If Category Password is filled in, customers will have to enter a password to view/buy products in this category)<br/>Category Password: ');

    **Repeat this with any other languages you use.

    ------------------------------------------------------
    FILE: /includes/languages/english/CUSTOM/index.php

    Find (on or around line 48):

    define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

    Add the following lines underneath it:

    define('CATEGORY_PASS_INVALID', '<h4 style="color: #ff0000;">Invalid Password</h4>');
    define('CATEGORY_INSERT_PASSWORD', '<h3>Category Locked</h3><p>For security reasons, this category is password protected. If you haven\'t been given the password, then you are not authorized to view this category.</p><strong>Please enter the password</strong>: ');

    **Repeat this with any other languages you use.

    ------------------------------------------------------
    FILE: /includes/languages/english/CUSTOM/product_info.php

    Find (on or around line 20):

    define('TEXT_PRODUCT_MODEL', 'Model: ');

    Add the following lines underneath it:

    define('CATEGORY_PASS_INVALID', '<h4 style="color: #ff0000;">Invalid Password</h4>');
    define('CATEGORY_INSERT_PASSWORD', '<h3>Category Locked</h3><p>For security reasons, this category is password protected. If you haven\'t been given the password, then you are not authorized to view this category.</p><strong>Please enter the password</strong>: ');

    **Repeat this with any other languages you use.

    ----------------------------------------------------------
    FILE: /includes/templates/CUSTOM/templates/tpl_index_product_list.php

    Find (on or around line 15):

    <div class="centerColumn" id="indexProductList">

    Add the following lines underneath it:

    <?php
    $passed = false;
    require($template->get_template_dir('tpl_category_pass_check.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_category_pass_check.php');
    if($passed) { //Begin Check for Password
    ?>


    Find (on or around line 208):

    } //// eof: categories

    Add the following line underneath it:

    } //// End Check for Password

    -----------------------------------------------------------
    FILE: /includes/templates/CUSTOM/templates/tpl_product_info_display.php

    Find (on or around line 16):

    <div class="centerColumn" id="productGeneral">

    Add the following lines underneath it:

    <?php
    $passed = false;
    require($template->get_template_dir('tpl_category_pass_check.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_category_pass_check.php');
    if($passed) { //Begin Check for Password
    ?>


    Find (on or around line 244):

    <!--bof Form close-->

    Add the following line underneath it:

    <?php } //End Check for Password ?>

  4. #14
    Join Date
    May 2008
    Posts
    203
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    This is very, VERY bad. All categories that have more than one item are now EMPTY. Please help!

  5. #15
    Join Date
    May 2008
    Posts
    203
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    removing the code from /includes/templates/CUSTOM/templates/tpl_index_product_list.php restored my lists, I'll wait to try again when I hear back from you.

    I also received this error after making my changes:

    http://nonfinite.org/passworderror.png

  6. #16
    Join Date
    Mar 2006
    Posts
    63
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    Checking to see if this is a working solution I need to do this but was wondering how well it was working.

  7. #17
    Join Date
    Mar 2006
    Posts
    63
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    SWEET! It works! man this was huge I needed this mod so bad! THANKS YOU ROCK!

  8. #18
    Join Date
    Mar 2010
    Posts
    3
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    All hail STEVISH

    We owe you one (or more)...installed and working GREAT. We have wanted to allow our wholesale dealers to purchase online, and not have the pages accessable to others...you have allowed that to happen. Thank you.

    View your work: http://wholesale.hearts4horses.com

    Thanks again,

    Bill

  9. #19
    Join Date
    May 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    did not work at all for me, it blocked ALL my categories and products on the admin panel.

    i had to restore all my files that were edited.

  10. #20
    Join Date
    Jul 2010
    Posts
    1
    Plugin Contributions
    0

    Default Re: Password Protected Categories (PPC) - Official Thread

    This works great, but I've run into a small problem and hope that someone can help. Password-protecting categories with products works as intended, and so does password-protecting individual subcategories, but is there anyway to password protect a category with subcategories? Right now, it will only password-protect the subcategories under a category, but not that top category even though I've put in a password for it in admin.

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. v151 Password Protect Categories by Ausgirl [Support Thread]
    By Ausgirl in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 20 Feb 2016, 06:33 PM
  2. v150 Admin Password Change Alert Message Display -- Support Thread
    By lat9 in forum All Other Contributions/Addons
    Replies: 13
    Last Post: 24 Dec 2015, 04:53 PM
  3. v151 Password Protected Categories Question
    By KrisTX in forum General Questions
    Replies: 5
    Last Post: 25 Sep 2014, 02:30 PM
  4. Products/Categories URLs Exporter Support Thread
    By joshuayang in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 28 Mar 2010, 05:33 PM
  5. Password Protected Categories
    By shonny in forum General Questions
    Replies: 5
    Last Post: 11 Jan 2008, 08:45 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