+ Reply to Thread
Results 1 to 4 of 4

Thread: Allow browsing only when logged in.

  1. #1
    Client
    Join Date
    Dec 2006
    Posts
    3
    Squirrelcart version
    not specified!

    Allow browsing only when logged in.

    I am trying to use this system to create a dealer catalog. I want to make it so only logged in users can view the catalog. When a user without an account tries to view the store they are shown a page that prompts them to login or to request a dealer account.

    Is there a way to require login to browse catalog or an easy way to rig it?

    Thanks in advance for any ideas.

  2. #2
    Client
    Join Date
    Mar 2010
    Posts
    9
    Squirrelcart version
    not specified!

    same solution required here

    I am looking for a solution to a very similar problem.

    Have you figured a good way to do this yet?

    Thanks,
    Andy

  3. #3
    Client
    Join Date
    Dec 2006
    Posts
    3
    Squirrelcart version
    not specified!

    Seems like I had a good start on it...

    if I remember correct it was a complicated fix that would definitely mess up future upgrades, but I'll try to point you down the path I took if I can remember it.

    keeping people from seeing the store while not logged in is pretty simple... all you have to do is check if user is logged in at start of store.php... with some code like:

    Code:
    <?php if (!$SC['user']) { header( 'Location: index.php' ) ; } ?>
    This will require you to use a different home page than the default store.php and redirect to it whenever user is not logged in. ( i have not used a current version of squirrelcart in years, this may have all changed)
    You can include the store login box on this page with
    Code:
    <? include "$cart_isp_root/login.php" ?>
    The tricky part came when you wanted to a let a non logged in user do things like create an account or reset a forgotten password, which all wants to happen inside the store. I built some workarounds for this but cant really remember the process. I had to hack several core files which is a nightmare for upgrades but I guess no upgrades is better than no store in the long run.

    Good luck, sorry I couldn't be more helpful, but its just been too long to remember exactly what I ended up doing. If nothing else, at least you know how to check if a user is logged in or not. That should at least get you hacking and see if you can figure it out.

  4. #4
    Client
    Join Date
    Mar 2010
    Posts
    9
    Squirrelcart version
    not specified!

    that helps a lot

    I think that will put me on the right track.

    I don't want to inhibit my ability to upgrade...

    Being a wholesale site, I expect the account can be created for them and all they'll have to do is login. Once logged in, they can change their password and edit their account information (shipping address, etc).

    Thanks for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts