Forums / General Questions / Require login to browse question

Require login to browse question

Locked

Views: 1,518

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
23 Aug 2010, 11:17 PM
#1
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Require login to browse question

Hello,

Is there a way to do this? I want customers to view a page with just links to information pages (about us, shipping, etc.) when they hit the home page. Also on the home page will be a login link. I want to require customer to login before they get to browse all the categories and products.

Currently I set admin>config>customer details>customer shop status to must login to browse. However this makes the home page the login page and I rather have a page before that if possible.

Thanks in advance for any help.

24 Aug 2010, 6:44 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Require login to browse question

admin > config > customer details > Customer Shop Status - View Shop and Prices >

Optionas are:
Customer must be approved to shop
0= Not required
1= Must login to browse
2= May browse but no prices unless logged in
3= Showroom Only

Zen-Venom Get Bitten

24 Aug 2010, 5:53 PM
#3
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Require login to browse question

Hi kobra,

Thanks for the reply. I know about that option but my question is regarding a page that shows up before the login page. When a customer visits the website, I don't want the home page to be a login page. I rather it be informational page and also have a login link. Is this possible?

Thanks.

24 Aug 2010, 9:18 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Require login to browse question

have look at the contents & commented directives in a copy of ypl_main_page.php and you will see many options for "this is home page"

Zen-Venom Get Bitten

16 Sep 2010, 11:28 PM
#5
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Require login to browse question

kobra,

where is this page located at?

thanks.

16 Sep 2010, 11:34 PM
#6
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Require login to browse question

nevermind, I think you meant tpl_main_page.php :)

17 Sep 2010, 6:09 PM
#7
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Require login to browse question

Hello,

So I read tpl_main_page.php, but still not sure how to accomplish this. I'm just trying to have the home page be a informational page instead of a login in page. My website is set to require customer authorization before browsing, so it currently automatically goes to the login page when someone visits the website. I don't want the login page. Only after they click a login link are they presented with the login page. Any ideas to get me going?

Thank you.

17 Sep 2010, 6:30 PM
#8
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Require login to browse question

Create an index.html page where you have your Zen Cart installed. Zen Cart uses index.php and browsers will pick up the index.html file first. Use the index.html page as the "information" page you require with a link to the index.php page.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

17 Sep 2010, 6:34 PM
#9
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Require login to browse question

Thank you very much afo, I will try that.

17 Sep 2010, 6:40 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Require login to browse question

Use the "2" setting in Customer Approval Status - Authorization Pending
Edit the tpl_main_page.php file to drop left & right columns
Move your desired links to be internal ezpage links that show in header
Edit your define mainpage through admin to state what you want

This presents a page different than the login page while still hiding your categories etc from view

Zen-Venom Get Bitten

17 Sep 2010, 6:49 PM
#11
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Require login to browse question

Kobra's solution may be much more elegant than mine. :smile:

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

17 Sep 2010, 8:04 PM
#12
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Require login to browse question

thanks kobra and afo, I appreciate the help. I think I need to elaborate on what I'm trying to do.

  1. First I want to keep the feature of "Must be Authorized to Browse". So setting the Approval Status to "2" is not gonna work because that allows them to browse.

What I want is:

  1. When someone visits the website, the first page they will see is just an informational page with a login link and possibly a few other links that just goes to a static page.

  2. Once they click login, they are presented with the login page (the login page that currently pops up right now since approval status is set to "1" must be authorize to browse)

  3. Once they are logged in, everything behaves as normal with header and footer links loaded dynamically and customers are able to browse and checkout.

I want to do in the way that stays in the framework of how zen is setup. However, it seems that the index.html way that afo suggested is a lot easier.

Kobra, I don't 100% understand the solution you gave. Its my fault because I'm still learning zen and the framework of which files gets loaded first and called and how everything is put together. Is the solution you gave me gonna work for what I want? I appreciate your help.

Thanks.

17 Sep 2010, 9:55 PM
#13
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Require login to browse question

I think I found out an area I can play with. In tpl_main_page.php, I can change the the code where it displays the center column depending if the user is logged in or logged out. Around line 243.

require($body_code); displays the center column. I can put a

<?php if ($_SESSION['customer_id'] > 0) { // I am logged in } else { // I am not logged in } ?>

and display the page accordingly.

Don't know if this will work, but I'm gonna try.

18 Sep 2010, 12:20 AM
#14
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Require login to browse question

Yes! I think I found a solution. Will test more tonight to make sure it really works before posting. It has to do with creating a new variable and passing it through the url. Base on the value of the variable, it will display the main info page or the login page. Also this solution stays in the framework of zen!:clap:

18 Sep 2010, 6:25 PM
#15
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Require login to browse question

Might also reference this and create a case or if for your condition
http://www.zen-cart.com/forum/showthread.php?t=164253

Zen-Venom Get Bitten