WebsiteBaker Support (2.8.x) > Bakery Shop

Hide price to unregistered users

(1/1)

premagraphic:
Hello, sorry for my bad english,
this module is really nice.
You can hide the price to unregistered users?
tanks.

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.

--- End quote ---

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 'somethingbehindthep rice', 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:

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

the price_hide_end droplet:


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



premagraphic:
Wonderful!
Can be reused anywhere?
I've solved a big problem. I understand the power of the droplets.
Thanks

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

Navigation

[0] Message Index

Go to full version