Forums / General Questions / Additional Product Description info IF logged in

Additional Product Description info IF logged in

Started by chadderuski on 9 May 2011, 2:02 PM · Views: 512

Results 1 to 3 of 3
9 May 2011, 2:02 PM
#1
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Additional Product Description info IF logged in

I have a situation where certain product information should only be displayed when a user is logged in much like when you set the store to view prices only when logged in.

I tried to add code like this to the products description:

<?php if ($_SESSION['customer_id']) { ?> <p>added info when logged in</p> <?php } ?>

But it appears the php code is being scrubbed from the description before output, and "<p>added info when logged in</p>" is always displayed.

Suggestions on how to best implement this would be appreciated, especially with the least amount of core modification.

thanks!

9 May 2011, 2:58 PM
#3
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Re: Additional Product Description info IF logged in

After more digging, I found a simple solution to modify tpl_product_info_display.php

from:

<?php echo stripslashes($products_description); ?>

to:

<?php echo eval(stripslashes('?>'.$products_description)); ?>

This does work, but I'm wondering if there is anything to be concerned about?