Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2009
    Location
    London
    Posts
    124
    Plugin Contributions
    0

    Default Ezpage only available to view after login?

    Dear All,

    Been searching on forum but can't find any exsiting thread about this.

    I would like to create a ezpage but only available for registered users. If they try to look at this page, it prompt them to log in or sign up and account. Is this possible?

    Many thanks for help.

    Genesis

  2. #2
    Join Date
    Jun 2007
    Posts
    71
    Plugin Contributions
    0

    Default Re: Ezpage only available to view after login?

    It seems that zen cart does not have control rights for different roles.
    LED flood Lights - Energy saving! Eco-friendly! Long lifespan.
    Bollard Lights - Excelllent design.

  3. #3
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: Ezpage only available to view after login?


  4. #4
    Join Date
    Apr 2009
    Location
    London
    Posts
    124
    Plugin Contributions
    0

    Default Re: Ezpage only available to view after login?

    I definately needed this feature. Here's an even simpler version.

    Replace this:

    Code:
    <div><?php echo $var_pageDetails->fields['pages_html_text']; ?></div>with this:


    Code:
    <div><?php eval(stripslashes('?>' . $var_pageDetails->fields['pages_html_text'])); ?></div>This way you don't have worry about php being 'on' in the ezpage - you can make the code of the page html with php inside it (a lot easier).

    Tim
    Where do I find those code?

  5. #5
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: Ezpage only available to view after login?

    Read the 6 messages above that one, then the 7th will make sense. Tim just simplified what I had posted above there.

  6. #6
    Join Date
    Feb 2010
    Posts
    6
    Plugin Contributions
    0

    Default Re: Ezpage only available to view after login?

    Hey guys,

    Thanks for this. In the code found on your link http://www.zen-cart.com/forum/showthread.php?t=53139

    <?php
    if ($_SESSION['customer_id']) {
    echo('You are signed in and have access to the members only area.');
    }else{echo('You are not signed in, and do not have access to the members only area.');}
    ?>

    Is it possible to specify a specific customer_id ? Like only show this page to customer id # 1?

    Thanks,
    Kristina

  7. #7
    Join Date
    Feb 2010
    Posts
    6
    Plugin Contributions
    0

    Default Re: Ezpage only available to view after login?

    I did it! For those who would like to know how to hide a page for logged in members AND only give access to a select member or members.

    Insert this in an ezpage: (to learn how to insert php in an EZpage, look at the link above)

    <?php
    if ($_SESSION['customer_id'] == "1" ) {
    echo('Access.');
    }else{echo('You are not signed in, and do not have access to the members only area.');}
    ?>

    Change number "1" to the customer number you want to have access to the page. You can find your customer number by going to "customers" in the admin section of your Zen Cart. The number is right next to the listing.

    Obviously, change the echo'' to the statement you want your logged in member to see.

 

 

Similar Threads

  1. Customer page only available after log in?
    By znowflake in forum General Questions
    Replies: 2
    Last Post: 1 Nov 2010, 04:41 PM
  2. Per Item option that's only available after a minimum quantity?
    By gbensonii in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 5 Oct 2009, 08:32 PM
  3. View cart link in ezpage links header to SHOW ALWAYS
    By jami1955 in forum Customization from the Admin
    Replies: 7
    Last Post: 8 Jun 2009, 02:01 PM
  4. Login/Admin not available after install.
    By askfritzdotcom in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 28 Mar 2007, 09:57 AM
  5. no shipping available after login
    By moktar in forum Bug Reports
    Replies: 14
    Last Post: 8 Feb 2007, 02:49 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