[Skip to main content](#vessel-content)

#   customize visibility on 'add to cart'

##

- **[tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")**
- [![tanjung.technology's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar279.gif)](/forum/user/279-tanjung-technology "View tanjung.technology's Profile") Topic Author
- [ Offline](/forum/user/279-tanjung-technology)

Less More

- Posts: 13
- Thank you received: 0
-
-
-
-

16 years 4 days ago [\#1587](#1587) by [tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")  *[customize visibility on 'add to cart'](/forum/4-how-to/1587-customize-visibility-on-add-to-cart#1587 "Hi there.. I want to make the 'add to cart' on products show in the front-end can only be seen by members. Is there a solution to this problem? Thank you")* was created by *[tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")*

Hi there..
I want to make the 'add to cart' on products show in the front-end can only be seen by members. Is there a solution to this problem?
Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1ODctY3VzdG9taXplLXZpc2liaWxpdHktb24tYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86560
- Thank you received: 14307
-
-

16 years 3 days ago [\#1590](#1590) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: customize visibility on 'add to cart'](/forum/4-how-to/1587-customize-visibility-on-add-to-cart#1590 "Hi there.. I want to make the 'add to cart' on products show in the front-end can only be seen by members. Is there a solution to this problem? Thank you")*

Hi,

You can edit the file show.php of the view product in Display-&gt;Views. There you can just check the status of the user like explained there: [ docs.joomla.org/Accessing\_the\_current\_us...t#Determining\_Status](http://docs.joomla.org/Accessing_the_current_user_object#Determining_Status)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1ODctY3VzdG9taXplLXZpc2liaWxpdHktb24tYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")**
- [![tanjung.technology's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar279.gif)](/forum/user/279-tanjung-technology "View tanjung.technology's Profile") Topic Author
- [ Offline](/forum/user/279-tanjung-technology)

Less More

- Posts: 13
- Thank you received: 0
-
-
-
-

16 years 3 days ago [\#1594](#1594) by [tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")  Replied by *[tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")* on topic *[Re: customize visibility on 'add to cart'](/forum/4-how-to/1587-customize-visibility-on-add-to-cart#1594 "Hi there.. I want to make the 'add to cart' on products show in the front-end can only be seen by members. Is there a solution to this problem? Thank you")*

I don't understand about the explanation on [ docs.joomla.org/Accessing\_the\_current\_us...t#Determining\_Status](http://docs.joomla.org/Accessing_the_current_user_object#Determining_Status). I have opened file show.php in display-&gt;views-&gt;product but I can not find which parts should be edited to make 'add to chart' does not appear if viewed by a guest.
Could you explain more about it, please? Thanks before.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1ODctY3VzdG9taXplLXZpc2liaWxpdHktb24tYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86560
- Thank you received: 14307
-
-

16 years 3 days ago [\#1595](#1595) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: customize visibility on 'add to cart'](/forum/4-how-to/1587-customize-visibility-on-add-to-cart#1595 "Hi there.. I want to make the 'add to cart' on products show in the front-end can only be seen by members. Is there a solution to this problem? Thank you")*

It's this code around line 60 which displays the button :
$this-&gt;row =&amp; $this-&gt;element;
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1ODctY3VzdG9taXplLXZpc2liaWxpdHktb24tYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")**
- [![tanjung.technology's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar279.gif)](/forum/user/279-tanjung-technology "View tanjung.technology's Profile") Topic Author
- [ Offline](/forum/user/279-tanjung-technology)

Less More

- Posts: 13
- Thank you received: 0
-
-
-
-

16 years 3 days ago [\#1601](#1601) by [tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")  Replied by *[tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")* on topic *[Re: customize visibility on 'add to cart'](/forum/4-how-to/1587-customize-visibility-on-add-to-cart#1601 "Hi there.. I want to make the 'add to cart' on products show in the front-end can only be seen by members. Is there a solution to this problem? Thank you")*

I've been entering code, but 'add to cart' button still visible in guest mode. When i try to enter another code, i got it appear beside product image in guest mode. I'm still stuck about this case. Hope You will be able to help Me. Thanks a lot for the solution.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1ODctY3VzdG9taXplLXZpc2liaWxpdHktb24tYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86560
- Thank you received: 14307
-
-

16 years 3 days ago [\#1605](#1605) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: customize visibility on 'add to cart'](/forum/4-how-to/1587-customize-visibility-on-add-to-cart#1605 "Hi there.. I want to make the 'add to cart' on products show in the front-end can only be seen by members. Is there a solution to this problem? Thank you")*

you should just replace the code I previously talked about by that code:

$user =&amp; JFactory::getUser();
if (!$user-&gt;guest) {
$this-&gt;row =&amp; $this-&gt;element;
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();
}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1ODctY3VzdG9taXplLXZpc2liaWxpdHktb24tYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")**
- [![tanjung.technology's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar279.gif)](/forum/user/279-tanjung-technology "View tanjung.technology's Profile") Topic Author
- [ Offline](/forum/user/279-tanjung-technology)

Less More

- Posts: 13
- Thank you received: 0
-
-
-
-

16 years 2 days ago [\#1676](#1676) by [tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")  Replied by *[tanjung.technology](/forum/user/279-tanjung-technology "View tanjung.technology's Profile")* on topic *[Re: customize visibility on 'add to cart'](/forum/4-how-to/1587-customize-visibility-on-add-to-cart#1676 "Hi there.. I want to make the 'add to cart' on products show in the front-end can only be seen by members. Is there a solution to this problem? Thank you")*

I'll try it many times, but 'add to cart' on my product description still appear and accessible by guest. Then, i modify your tips and make it disable to access 'add to cart' by guest. In joomla-&gt;components-&gt;controllers-&gt;product.php I put code:
$user =&amp; JFactory::getUser();
if (!$user-&gt;guest){'function update cart'}
Then, guest can't access add to cart button.
Thank you for your suggestion.
![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE1ODctY3VzdG9taXplLXZpc2liaWxpdHktb24tYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.076 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
