Jump to content

How to hide prices for not logged in clients?


Recommended Posts

Hello there.

 

I would like to setup a shop for wholesellers where visitors can not see the prices.

The prices will only be shown if they are logged into the website AND when they are beloning to a specific group (verfied whole sellers)

 

So the site must be running in "catalog mode" by default and only for clients belonging to the "verified whole sellers" get access to the website in "shopping mode".

 

Does anybody know how i can achieve this?

 

Thanks in advance!

 

Rey

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi there.

 

I just wanted to add my two cents because I was searching for the same thing.

 

What i did was just check for $isLogged in the template.

 

That is, in my template, I check if the user is logged in and only then display the price.

 

For me the relevant code is in yourtemplate/product-list.tpl and yourtemplate/category.tpl. Anywhere the price is displayed.

 

And I surround my price html part with:

{if $isLogged}
  Display price html
{/if}

 

so... pretty easy. Hope this helps someone else.

Link to comment
Share on other sites

Hi there.

 

I just wanted to add my two cents because I was searching for the same thing.

 

What i did was just check for $isLogged in the template.

 

That is, in my template, I check if the user is logged in and only then display the price.

 

For me the relevant code is in yourtemplate/product-list.tpl and yourtemplate/category.tpl. Anywhere the price is displayed.

 

And I surround my price html part with:

{if $isLogged}
  Display price html
{/if}

 

so... pretty easy. Hope this helps someone else.

 

This is a method recommended by some people and is always portrayed as an easy solution. But doesn't address things like displaying the shopping cart, specials, and so on. One must either continue to implement this sort of logic throughout their site or have a site not showing prices but still the cart and other modules and let's not forget about add to cart buttons? Anyway it's not as simple a solution as it's always portrayed.

 

Our module manipulates PrestaShop catalog mode at session level. No modifications to your themplates, modules, etc and with only three lines of additional code by user request.

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

Hi there.

 

I just wanted to add my two cents because I was searching for the same thing.

 

What i did was just check for $isLogged in the template.

 

That is, in my template, I check if the user is logged in and only then display the price.

 

For me the relevant code is in yourtemplate/product-list.tpl and yourtemplate/category.tpl. Anywhere the price is displayed.

 

And I surround my price html part with:

{if $isLogged}
  Display price html
{/if}

 

so... pretty easy. Hope this helps someone else.

 

This code not work with 1.4.9.0

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...

Hi all,

I've just installed 1.6.0.9 version.

I would like to use your feature to hide the product prices and the possibility to make orders for a visitor.

 

Is this the correct code ?

 

{if $logged}
Show prices
{else}
Log-in to view prices
{/if}

 

 Are you so kind to say where to add this code ? Is it in a particular position of program ?

Many thanks

Giovannino

  •  
Link to comment
Share on other sites

  • 1 year later...

Hi.

 

Hi have 1.6.1.4 and after disable the prices for visitor and guest, the prices are still show when not logged in.

 

Am I missing something here?

 

only for front page or also for category list and products?

 

often times when we affect prices either by change of price or by hiding price, the front page (index) will not show change,  this is solved by clearing cache bo-->advanced parms-->performance-->click clear cache top right.

 

else this can be issue 1) of a cache module 2) a cache feature of hosting 3) badly coded non-compliant theme.

Edited by El Patron (see edit history)
Link to comment
Share on other sites

Hi.

 

Thank you for your reply.

 

I've tried that without success.

 

The only way I found to accomplish that was checking for the variable $logged em many of the {if} found in the code for products.tpl and products-list.tpl.

 

That way I've managed to hide prices.

 

Please see the attached changed files.

 

But i suppose this should work without this changes.

 

PS: sorry, don't have permissions to upload files.

Link to comment
Share on other sites

  • 7 years later...

Hello!

I don't know if this was already published but I think it should help someone.

Currently, in Pretashop 1.7, there's an option in store parameters -> customers config -> groups

image.thumb.png.11344e65025c0818c0e7b868bbd643e9.png

and here you can decide if show the price of specific customer groups.

I hope it helps someone.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...