Hide price to unregistered users

snark

with these droplets and variations of these droplets you can comment out anything for logged in or not logged in visitors

the link I placed shows the same thing used to show the total amount of downloads from the downloadmodule only to logged in users.

I have also used it to hide a complete section on a page

premagraphic

Wonderful!
Can be reused anywhere?
I've solved a big problem. I understand the power of the droplets.
Thanks
Orazio Foti
Web & Multimedia Designer

snark

Quote from: premagraphic on July 09, 2010, 10:51:15 AM
Hello, sorry for my bad english,
this module is really nice.
You can hide the price to unregistered users?
tanks.

https://forum.websitebaker.org/index.php/topic,18542.0.html

the price will be viewable in de code of the page but if one doesn't know one doesn't search ...

change "[price]" to: "[[price_hide_start]][price][[price_hide_end]]"

problem then is that you will create an empty droplet's output for the price_hide_end droplet if the user is loggend in
so be sure to fill something in where I have put 'somethingbehindtheprice', a comma something like that should work

reason why I use to droplets is that the [price] tag used in bakery will not work if it is placed by the droplet



price_hide_start droplet:
global $database, $wb;
if ($wb->is_authenticated() ) {                   
return 'price: ';
}
else {
return '<!--';
}


the price_hide_end droplet:

global $database, $wb;
if ($wb->is_authenticated() ) {                   
return 'somethingbehindthepric';
}
else {
return '-->';
}





premagraphic

Hello, sorry for my bad english,
this module is really nice.
You can hide the price to unregistered users?
tanks.
Orazio Foti
Web & Multimedia Designer