Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Sep 2007
    Location
    Croatia
    Posts
    8
    Plugin Contributions
    0

    Default I want to hide the left column for not-logged-in visitors

    Hello, I'm trying to hide left column (category, ez pages, info etc.) from the non-registered users, but it is not working.

    Searching the forum about this subject I found similar topic which is also unresolved, so I tought to report the problem.

    I am using fresh ZC v1.3.8a install with no addons.

    My Admin > Configuration > Customer details are following:
    • Customer Shop Status - View Shop and Prices = 2
    • Customer Approval Status - Authorization Pending = 2
    • Customer Authorization: filename = customers_authorization
    • Customer Authorization: Hide Column Left = true

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Hide column bug?

    Can you explain a little more about the "why" behind wanting to do the hiding?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Hide Column Left does not work

    Add code below to stylesheet of CURRENT Template
    Code:
    #navColumnOne {display:none}

  4. #4
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Hide Column Left does not work

    Add code below to stylesheet of CURRENT Template
    Code:
    #navColumnOne {display:none}

  5. #5
    Join Date
    Sep 2007
    Location
    Croatia
    Posts
    8
    Plugin Contributions
    0

    Default Re: Hide column bug?

    Quote Originally Posted by DrByte View Post
    Can you explain a little more about the "why" behind wanting to do the hiding?
    I am creating a t-shirt web-shop. My intention is to show category items, gallery, detail information etc. only to the registered users. On the main page non-registered users will see only featured products and banner for something like: "Why not register? Unlock / see / view all t-shirts, check out the gallery of our customers, review products, ... "

  6. #6
    Join Date
    Sep 2007
    Location
    Croatia
    Posts
    8
    Plugin Contributions
    0

    Default Re: Hide Column Left does not work

    Quote Originally Posted by misty View Post
    Add code below to stylesheet of CURRENT Template
    Code:
    #navColumnOne {display:none}
    Thank you misty for the comment but this will completely remove the column from the template. My wish is to hide the columns from the non-registered users and make it visible only when they register.

  7. #7
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Hide Column Left does not work

    If you wish to disable certain sideboxes only to non members then
    https://www.zen-cart.com/tutorials/i...hp?article=279
    should help..

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: I want to hide the left column for not-logged-in visitors

    Moderator Note: Since this discussion has digressed from the alleged bug report aspect, it has been moved to a different forum category for further discussion.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Sep 2007
    Location
    Croatia
    Posts
    8
    Plugin Contributions
    0

    Default Re: Hide Column Left does not work

    Quote Originally Posted by misty View Post
    If you wish to disable certain sideboxes only to non members then
    https://www.zen-cart.com/tutorials/i...hp?article=279
    should help..
    With this tutorial I can hide from registered users following sideboxes:
    • banner_box.php
    • banner_box2.php
    • banner_box_all.php
    • best_sellers.php
    • currencies.php
    • featured.php
    • languages.php
    • manufacturers.php
    • product_notifications.php
    • search_header.php
    • shopping_cart.php
    • specials.php
    • tell_a_friend.php
    • whos_online.php


    How do I hide categories.php, ezpages.php and information.php since they do not contain $show_XY?

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: I want to hide the left column for not-logged-in visitors

    To control a sidebox and when it displays you are just needing to stop the code from running in the:
    /includes/modules/sideboxes/blah_blah.php
    /includes/templates/templates_default/sideboxes/blah_blah.php

    file that has the code ...

    I prefer to copy both peices of a sidebox to the overrides to avoid confusion on what is customized and what is not ...
    /includes/modules/sideboxes/your_template_dir/blah_blah.php
    /includes/templates/your_template_dir/sideboxes/blah_blah.php

    To manage the control of the code, you customize the file:
    /includes/modules/sideboxes/your_template_dir/blah_blah.php

    For example, look at the
    /includes/modules/sideboxes/tell_a_friend.php

    code and how that is constructed:
    Code:
    // test if box should display
      $show_tell_a_friend= false;
    
      if (isset($_GET['products_id']) and zen_products_id_valid($_GET['products_id'])) {
        if (!($_GET['main_page']==FILENAME_TELL_A_FRIEND)) $show_tell_a_friend = true;
      }
    
      if ($show_tell_a_friend == true) {
        require($template->get_template_dir('tpl_tell_a_friend.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_tell_a_friend.php');
        $title =  BOX_HEADING_TELL_A_FRIEND;
    
        $title_link = false;
        require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
      }
    
    The IF statement has a variable $show_tell_a_friend which when true allows the code to run ... when false the code will not run and the sidebox is disabled, even though it is set to run in the Layout Boxes Controller ...

    To manage any other sidebox, you do the same thing where you set a variable with a condition to set true or false and then use that variable to run the code or not ...

    Many sideboxes already have a variable set as they have conditions as part of the original code ...

    Those sideboxes that do not have a variable can, but simply adding the variable and the conditions to set it to true or false and then surrounding the code with an IF that lets the code run or not based on that condition ...

    The categories sidebox:
    /includes/modules/sideboxes/categories.php

    has the code:
    Code:
        $main_category_tree = new category_tree;
        $row = 0;
        $box_categories_array = array();
    
    // don't build a tree when no categories
        $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1");
        if ($check_categories->RecordCount() > 0) {
          $box_categories_array = $main_category_tree->zen_category_tree();
        }
    
        require($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php');
    
        $title = BOX_HEADING_CATEGORIES;
        $title_link = false;
    
        require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    There isn't, by default, a variable set to control the condition of when to run this, so one needs to be added and the IF needs to be added to control the code ...
    Code:
    // test if box should display
      $show_categories= false;
    
    if (something_happens_here) {
      // run the code
        $show_categories= true;
    } else {
    // do not run the code
      $show_categories= false;
    }  
    
    if ($show_categories == true) {
        $main_category_tree = new category_tree;
        $row = 0;
        $box_categories_array = array();
    
    // don't build a tree when no categories
        $check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1");
        if ($check_categories->RecordCount() > 0) {
          $box_categories_array = $main_category_tree->zen_category_tree();
        }
    
        require($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php');
    
        $title = BOX_HEADING_CATEGORIES;
        $title_link = false;
    
        require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }   
    Again, follow the use of the templates and overrides to make life easier on future upgrades ...

    Easy smeazy, eh?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Not working: Customer Authorization: Hide Column Left ?
    By seanzhu in forum Customization from the Admin
    Replies: 2
    Last Post: 7 Sep 2010, 12:00 PM
  2. Want to all subcategies in left column
    By Player in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 31 Aug 2010, 11:03 AM
  3. Hide Column Left switch does not work
    By sfatula in forum Bug Reports
    Replies: 2
    Last Post: 27 Sep 2006, 07:43 PM
  4. Hide Column Left doesn't work?
    By sfatula in forum General Questions
    Replies: 4
    Last Post: 27 Sep 2006, 05:50 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