Author Topic: Hide price to unregistered users  (Read 2479 times)

Offline premagraphic

  • Posts: 21
  • Gender: Male
    • www.oraziofoti.it
Hide price to unregistered users
« 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.
Orazio Foti
Web & Multimedia Designer

snark

  • Guest
Hide price to unregistered users
« Reply #1 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.

http://www.websitebaker2.org/forum/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 '-->';
}




Offline premagraphic

  • Posts: 21
  • Gender: Male
    • www.oraziofoti.it
Hide price to unregistered users
« Reply #2 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
Orazio Foti
Web & Multimedia Designer

snark

  • Guest
Hide price to unregistered users
« Reply #3 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

 

postern-length