WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: premagraphic on July 09, 2010, 10:51:15 AM

Title: Hide price to unregistered users
Post by: 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.
Title: Hide price to unregistered users
Post by: snark on July 09, 2010, 06:06:44 PM
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 '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: [Select]
global $database, $wb;
if ($wb->is_authenticated() ) {                   
return 'price: ';
}
else {
return '<!--';
}

the price_hide_end droplet:

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



Title: Hide price to unregistered users
Post by: premagraphic on July 09, 2010, 08:05:20 PM
Wonderful!
Can be reused anywhere?
I've solved a big problem. I understand the power of the droplets.
Thanks
Title: Hide price to unregistered users
Post by: snark on July 10, 2010, 09:11:02 AM
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