Forums / Templates, Stylesheets, Page Layout / Show Product Description only when logged in

Show Product Description only when logged in

Views: 963

Results 1 to 9 of 9
29 Mar 2012, 12:48 AM
#1
fsu711 avatar

fsu711

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Show Product Description only when logged in

I was wondering if there is any way to make the Product Description behave exactly like the Product Price. By that I mean that I currently have the price hidden unless a customer logs in, and I would like the description to also be hidden unless a customer logs in.

I think it has something to do with the tpl_product_info_display.php file, but I'm not sure. I've messed around with it, but no luck yet.

Thanks.

29 Mar 2012, 3:10 PM
#2
ironlady avatar

ironlady

New Zenner

Join Date:
Feb 2012
Location:
Indonesia
Posts:
10
Plugin Contributions:
0

Re: Show Product Description only when logged in

Yes, It is possible. You just need to add the condition around the product description block of code on tpl_product_info_display.php

<?php if(isset($_SESSION['customers_id'])){ ?>

<!--Product Description Block Code-->

<?php } ?>
29 Mar 2012, 3:12 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Show Product Description only when logged in

Note that will kill a lot of spider food ... :unsure:

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!

30 Mar 2012, 4:55 AM
#4
fsu711 avatar

fsu711

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Re: Show Product Description only when logged in

Thanks for the tip. However, that seemed to have no effect on the product description.

30 Mar 2012, 12:55 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Show Product Description only when logged in

There is a typo on that ... use customer_id without the S:

<?php if(isset($_SESSION['customer_id'])){ ?>

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!

30 Mar 2012, 9:07 PM
#6
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Show Product Description only when logged in

What about a CSS trick so to display:none all of the product description divs, images etc until you're logged in. That way spiders will still read it, but humans can't.

30 Mar 2012, 9:50 PM
#7
fsu711 avatar

fsu711

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Re: Show Product Description only when logged in

Ajeh:

There is a typo on that ... use customer_id without the S:

<?php if(isset($_SESSION['customer_id'])){ ?>

That worked perfectly.  Thank you!


> **dgent:**
>
> What about a CSS trick so to display:none all of the product description divs, images etc until you're logged in. That way spiders will still read it, but humans can't.

I'll try this also, thanks for the tip.
30 Mar 2012, 11:20 PM
#8
fsu711 avatar

fsu711

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Re: Show Product Description only when logged in

Wow, ok. Looks like my customer changed their mind. Now they only want a portion of the product description hidden, which I don't think can be done. Can it?

4 Apr 2012, 10:57 PM
#9
fsu711 avatar

fsu711

New Zenner

Join Date:
Mar 2012
Posts:
5
Plugin Contributions:
0

Re: Show Product Description only when logged in

Figured it out. Added a new property to my products, and put the information I needed hidden in there. Thanks everyone for all the help.