Price visibility

Hello !

I have the following problem: I want only logged in costumers to see the price of the products in my shop. How can I do this ? Is there a variable to check the login status ?

I'm using the B to B login theme, but I have already changed things.

Thanks


Hmmm interesting

ignition's picture

Hmmm interesting problem.
Here is what you can try.
You should go in product page, find item "password protection". There you have two sheets - first is password protection and the other is password protection settings. Choose second one. In the first line ( The URL where directed after login) you should write what you would like to see on the page, when customer has logged in and second line (The URL where directed after logout) you should enter the url where to go after logout. Than it should work helpfully. Of course both of those links should go to different product list pages. One that is without prices and the other is with them for logged customers.

ps the custom page URL is entered like this:
PublishedService?file=page&pageID=18&freePage=287
the only thing you will need to change is the free page. just type the number of custom page that you have created.

pps I tried it myself and while it works it still not really good method and requires quite a bit of time to implement.

Sorry for a bit misleading-

ignition's picture

Sorry for a bit misleading- I typed previous post a bit incorrectly.
I have now corrected it.

Why not use some Javascript?

Javascript is the way to solve this, where ever you want to display the price replace it with the following code between the ***...

*****************************
<script type="text/javascript">
if ("$customer_answer_name$1" == "1" )
{
document.write ("<b>Login to see prices</b>")
}
else
{
document.write("<div class='price'>£$product_price$</div>")
}
</script>
*********************************

Just replace "Login to see prices" with what you want to display when someone looks at the page who is not logged in.

Regards

I used javascript...

I added a pasword protected section to the productlist, In which I do the following:

html for login: ... var prijs = 'Login to see Price'; ...
html for logout: ... var prijs = '$product_price$'; ...

and in the product page, I just call that variable.

As I have more pass-protected Items on that page, this is the easiest I think..

Thanks anyway !

thanks

this is very clever indeed