Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 34
  1. #11
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: members only area

    Try membership mod..
    http://www.zen-cart.com/index.php?ma...roducts_id=492
    Then create ezpages that can only be seen by members
    or certain group of members that are logged in..

  2. #12
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    Thanks misty - I think all customers have to be members with this mod. I require customers categorised into members and non-members.

    thanks fairestcape once again for the offer of releasing some of Scott's work should he be in agreement. I may pursue this route, but I have made some progress with the php coding.

    This the code:

    <?php

    $custID = $_SESSION['customer_id'];

    if ($custID > 0)
    {
    $host="localhost";
    $user="username";
    $password="password";
    $database="database name";
    $connection = mysql_connect($host, $user, $password)
    or die ("Could not connect");
    $db = mysql_select_db($database, $connection)
    or die ("Could not connect");

    $query = "SELECT customers_firstname, customers_lastname, customers_id, customers_newsletter from customers WHERE customers_id=$custID";
    $result = mysql_query($query)
    or die ("couldn't execute query");

    $row = mysql_fetch_array($result,MYSQL_BOTH);

    $newlettercode = $row[3];

    if ($newlettercode == 0)
    {echo "non member - please purchase membership subscription above";}
    else
    {echo "link to members section";}

    }
    else
    { echo "<br>Please log in if you are a member<br> ";}


    ?>
    If it of use to anyone - please copy

    Basically it checks the sesion variable $_SESSION['customer_id']; which is null if no-one is signed in - or contains the customer_id if signed in.
    The program also checks the newsletter field for that customer and if set to 1 allows entry to the members area, if set to 0 suggests buying a members subscription and disallows access.

    I've checked it out a few times with my dummy database and it seems to work ok.

    I have used this on the Define Pages Editor/define_main_page.php
    file - I now need to look at combining the graphics with the code

    thanks again

    Derek

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

    Default Re: members only area

    Tried your code, added to define_main page...works but on logging in as member,
    see message but all products disappear from main
    page??

  4. #14
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    Hi Misty

    Do you mean the new products banners? Mine does the same

    Is this a normal funcion of Zen Cart when you log-in?

    I'm trying to find a way of checking it out

    I haven't altered any zen code - only added the code on the define_main_page

    Derek

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

    Default Re: members only area

    Yes, removes centre boxes for new,featured,special products
    and no, normally this is not supposed to happen..

  6. #16
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    thanks

    I've really used the main_page to check out the php coding for the members only area. Don't know why it has this effect, but the actual code will be attached as a behaviour to some sort of membership area button, so hopefully, it shouldn't effect things.

    Thanks for pointing it out.

    Derek

  7. #17
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    I think I've cracked it!

    If you comment out the lines :

    $connection = mysql_connect($host, $user, $password)
    or die ("Could not connect");
    $db = mysql_select_db($database, $connection)
    or die ("Could not connect");

    everything seems ok - the database/user connection is probably set up in an .ini file

    Derek

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

    Default Re: members only area


    Yes that fixed problem with disappearing centre boxes..am assuming
    that you will be placing link in code to replace text
    link to members section

  9. #19
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: members only area

    The plan is to have a members section entry button on the front page. This code will be activated upon "depression" of this button.

    I really wanted to check out the functionality of the code with Zen, before looking at the graphics and implementation.

    Derek


  10. #20
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Idea or Suggestion Re: members only area

    If anyone is interested in this thread, I have made some more progress.
    The site in question is www.baitworks.co.uk
    I had to write some php code to set all customers_newsletter fields = 0 in the database.
    Other php code appears at the top of the membership define pages to check membership validity, i.e. whether this field has been (manually) set to 1 on receipt of membership subscription.
    Most probably going to use the date of birth field to show membership end.
    Hope this is clear - please contact me for and help/clarification

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Members only area
    By jlong in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 8 Jan 2011, 07:11 PM
  2. members only: hiding the products from non members
    By poosk in forum General Questions
    Replies: 2
    Last Post: 18 Nov 2009, 04:17 PM
  3. Add a members only area
    By jdl in forum General Questions
    Replies: 8
    Last Post: 3 May 2007, 02:46 PM
  4. Replies: 7
    Last Post: 3 May 2007, 04:40 AM

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