Jump to content

<SOLVED>Hide Add to cart button for non logged in visitors.


Recommended Posts

Hi,

 

I would like to hide the "add to cart button" for non logged in visitors. So that they're not able to purchase any products. However they must be able to see the price. I found this in the forum but that's not for version 1.6:

http://www.prestashop.com/forums/topic/85872-solved-hide-add-to-cart-button-until-logged-in/

 

 

Any ideas on how to solve this in V 1.6?

 

Cheers,

 

Steven

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

This should be the php var

 

$this->context->customer->isLogged()

 

But it won't work in templates, you need to assign it somewhere. You might create a custom module that hooks to the header, so it's available on all the page :)

Link to comment
Share on other sites

at the moment prestashop hasn't got feature to "hide" add to cart button, you can only change group settings, but it will hide not only add to cart button, but only the price

 

i think, that with little modification on product-list.tpl and product.tpl it will be possible

but what with other modules where price of product appears?

Link to comment
Share on other sites

Hi Guys,

 

Thanks for the reply. Disable only on product-list.tpl and product.tpl will be just fine. So I guess I have to put the var $this->context->customer->isLogged() somewhere (in which file?)  and modify the 2 tpl files (exactly how ?) right?

 

Your help is much appreciated!

 

Cheers

 

I found this solution: http://catalogo-onlinersi.net/en/add-ons-prestashop-modules/328-hide-price-and-add-to-cart.html Works fine for me:)

Edited by steviger (see edit history)
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...