Forums / Setting Up Categories, Products, Attributes / Category Accessible only To Newsletter Subscribers

Category Accessible only To Newsletter Subscribers

Locked

Views: 1,002

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
23 Aug 2009, 6:47 AM
#1
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Category Accessible only To Newsletter Subscribers

Forgive me if this has been posted numerous times already lol, I have searched and nothing I have found is matching what I want...

I want to set up a category with products that are only available to newsletter subscribers, I don't want to sell these certain products, I just want them to be available for free to newsletter subscribers only, I don't mind if they are visible to all....is there a way to set up a category so that only newsletter subscribers can add them to cart and checkout with them?

I have the Hide Categories Mod and have checked out threads on password protect and many others, but none of these suit what I want to do lol I also have a paid modification that will allow me to do something similar via group pricing...but again, I don't want these items available for sale, I want them exclusive to newsletter subscribers.

HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

23 Aug 2009, 8:12 PM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Category Accessible only To Newsletter Subscribers

I am not sure that i have seen anything like this but, who knows, I might be wrong....

If you wanted to do it then it is possible with a bit of php.

Have a look at the code below. (from tpl_header)

<?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>

That's the chunk of code (without the closing bits for the if statement) that navMain uses to create the 'log off' and 'your account' links that appear when a customer is logged in.

A similar chunk of code could be constructed that would check if a customer is logged in and then if they are subscribed to the newsletter (customers_newsletter=1) and if both these criteria were met then display the link to the special category.

Nick
iszent.com

24 Aug 2009, 3:24 AM
#3
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Category Accessible only To Newsletter Subscribers

Thanx for the reply Nick :)

I don't think that's quite what I want though, but I will look into it.

HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

24 Aug 2009, 7:27 AM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Category Accessible only To Newsletter Subscribers

Oh,sorry, I had thought that you wanted a way to distinguish between newsletters subscribers and other customers that would allow you to present different features to each group by either adjusting if the category was displayed or disabling/enabling the 'add to cart' button (or any other layout change for that matter). Sorry if I misunderstood.

Nick
iszent.com

24 Aug 2009, 7:58 AM
#5
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Category Accessible only To Newsletter Subscribers

Oh no don't be sorry :)

Anything that gets the old gray matter moving helps...I might look into your mention of enabling/disabling the add to cart button based on newsletter subscription...that sounds like a go-er if I can figure out the coding lol

HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

24 Aug 2009, 8:20 AM
#6
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Category Accessible only To Newsletter Subscribers

Well the coding is going to involve a bit of php. You'll need an if statement. It is going to look like the statement that I posted before but altered to include the newsletter field check

The logic of it is:

if ( customer is logged in AND customer_newsletter = 1 AND this is a 'free to newsletter subscribers product')

---print the 'add to cart button' normally.

else

---print a 'only newletter subscribers get this free'

But the if/else code can be put around any page item in principle. So it could equally well be put around the category link so that non subscribers just wouldn't be able to get to that category. Or it could be put in the header as a 'free offers!' display.

There is going to be a bit of nifty coding depending on which of the various options you decide on because you need to ensure that this is only applied to certain products. In some ways the easiest coding is to hide the link to the category or have a 'free offers' display because then you don't need to tailor the code to different products.

In other words the if statement doesn't need to check if this is a 'free to newsletter subscribers' product.

Nick
iszent.com

24 Aug 2009, 8:37 AM
#7
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Category Accessible only To Newsletter Subscribers

But to be of any more help one would really need to know which of the various options you think is a good approach for you. Also, if you are going to go the route of enabling/disabling the 'add to cart' display then one would need to know how your cart is set up. Do the 'add to cart' features exist only on the product info pages or do they appear on the product listing pages as well? Also good to know would be if the free products are going to all be in the same category. If they are then the category_id can be used to 'decide' whether to display the add to cart.

Nick
iszent.com

25 Aug 2009, 10:25 PM
#8
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Category Accessible only To Newsletter Subscribers

I was thinking along the same lines with the cat id lol but I am gonna hafta put the whole thing on hold a while...I'm having some medical issues that need checking into sigh lol thanx for knocking back and forth with me :)

HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe