Forums / Templates, Stylesheets, Page Layout / Making a category only visible after login

Making a category only visible after login

Locked

Views: 3,229

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
9 Oct 2007, 7:53 AM
#1
sparkiii avatar

sparkiii

New Zenner

Join Date:
Jun 2007
Posts:
93
Plugin Contributions:
0

Making a category only visible after login

HI, I have found loads of threads on password protecting a category and also about hiding a category, only visible through URL link. BUT what about only having certain categories available for viewin after a customer has logged in. Is that able to be done.

Nat

10 Oct 2007, 5:49 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Making a category only visible after login

Do you mean links and images and listings etc. where anything to do with the product(s) in those categories do not show unless someone is logged in?

Currently you can limit the ability to see prices or shop etc. until the customer is logged in ...

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!]
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!

11 Oct 2007, 4:09 AM
#3
sparkiii avatar

sparkiii

New Zenner

Join Date:
Jun 2007
Posts:
93
Plugin Contributions:
0

Re: Making a category only visible after login

Ideally what I would want would be for the category header to be able to be seen, but if they try and view it they would need to login or register first. This is for the sale of sporting photographs, juniors photos would need to be members only. But seniors photos wouldnt not need login first.

My thought at the moment is to have a site up front with links to 2 seperate carts one for juniors and one for seniors, and just have a password protection set up there. This is the way I might end up heading as login within the site can still be done by anyone.

Does this make sense.

Nat

11 Oct 2007, 4:49 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Making a category only visible after login

To control the Product Listing ... you can edit the file:
/includes/index_filters/default_filter.php

And create this variable $block_these:

if (isset($_SESSION['customer_id']) && $_SESSION['customer_id'] > 0) {
  $block_these = '';
} else {
  $block_these = " and p.master_categories_id != 10 ";
}

and add to each set of WHERE settings ...

Now how you set the condition is up to you ... this example blocks categories_id 10 on the assumption master_categories_id is 10 ...

Then to do the searches, you can customize the file:
/includes/modules/pages/advanced_search_results/header_php.php

and use the same code and add to the last set of WHERE settings ...

You can do this anywhere you want this to happen ...

Or, you can take the approach of an intercept page where they see some info but when they try to get to detail it is blocked ...

Or, you can change those products to be Login Only products by altering the function(s) for the buy and add to cart ...

There are a number of approaches that could be used to close off products ...

So it's time to get your coder hat on ... :smartalec:

Or, time to find someone who is a glutton for punishment ... er ... a coder who can write this for you ...

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!]
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!

18 Nov 2007, 9:10 PM
#5
hifipj avatar

hifipj

New Zenner

Join Date:
Oct 2007
Posts:
43
Plugin Contributions:
0

Re: Making a category only visible after login

Hi Linda,

I had the same question. So to summarize, you are saying that right now without custom coding, there is no way to have a category only be visible AFTER the customer logs in?

I'd like to be able to show a few general categories to everyone who browses my site, but require login for them to see all product details/photos, etc.

Thanks!
Patrick

18 Nov 2007, 9:22 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Making a category only visible after login

The hideCategory mod in Downloads is intended for allowing only certain logged-in customers to see certain categories. It could probably be set up to allow all logged-in customers to see those categories.

4 Jul 2010, 9:29 PM
#7
townsend2009 avatar

townsend2009

New Zenner

Join Date:
Nov 2008
Posts:
93
Plugin Contributions:
0

Re: Making a category only visible after login

Pulling up an old thread here, but it's the one I could find that was most like my question.

-When a user visits my shop they can see all but one category. We'll call this category "for PHOTOGRAPHERS" and has a category ID of 75.

When this user registers on my site, I add them to the group pricing called "Wholesale Account" if they are a wholesale member. Once the user visits my site again and logs in as a wholesale member, they can then see the "for PHOTOGRAPHERS" category.

How can I set this up?
TIA!

13 Jul 2010, 3:59 AM
#8
drift83 avatar

drift83

New Zenner

Join Date:
Mar 2010
Posts:
6
Plugin Contributions:
0

Re: Making a category only visible after login

I would also like this same setup.

any ideas?

7 Nov 2010, 12:14 PM
#9
1141 avatar

1141

New Zenner

Join Date:
Oct 2010
Posts:
1
Plugin Contributions:
0

Re: Making a category only visible after login

Ajeh:

To control the Product Listing ... you can edit the file:
/includes/index_filters/default_filter.php

And create this variable $block_these:

if (isset($_SESSION['customer_id']) && $_SESSION['customer_id'] > 0) {
$block_these = '';
} else {
$block_these = " and p.master_categories_id != 10 ";
}

> 
> and add to each set of WHERE settings ...
> 
> Now how you set the condition is up to you ... this example blocks categories_id 10 on the assumption master_categories_id is 10 ...
> 
> Then to do the searches, you can customize the file:
> /includes/modules/pages/advanced_search_results/header_php.php
> 
> and use the same code and add to the last set of WHERE settings ...
> 
> You can do this anywhere you want this to happen ...
> 
> Or, you can take the approach of an intercept page where they see some info but when they try to get to detail it is blocked ...
> 
> Or, you can change those products to be Login Only products by altering the function(s) for the buy and add to cart ...
> 
> There are a number of approaches that could be used to close off products ...
> 
> So it's time to get your coder hat on ... :smartalec:
> 
> Or, time to find someone who is a glutton for punishment ... er ... a coder who can write this for you ...

Im fnding this alitttle difficult. are you saying theat the only way to get thiis (members only category ) is to pay some one to do it? 

I give up is any one out there willing to write this script for me  please email me.
7 Nov 2010, 2:26 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Making a category only visible after login

I am saying that if you cannot figure out how to apply these changes yourself, that you may need additional help and usually that requires parting with a few $$$ to get someone to help you ...

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!]
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!