- Posts: 13
- Thank you received: 0
customize visibility on 'add to cart'
- tanjung.technology
-
Topic Author
- Offline
Less
More
15 years 10 months ago #1587
by tanjung.technology
customize visibility on 'add to cart' was created by tanjung.technology
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 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 or Create an account to join the conversation.
15 years 10 months ago #1590
by nicolas
Replied by nicolas on topic Re: customize visibility on 'add to cart'
Hi,
You can edit the file show.php of the view product in Display->Views. There you can just check the status of the user like explained there: docs.joomla.org/Accessing_the_current_us...t#Determining_Status
You can edit the file show.php of the view product in Display->Views. There you can just check the status of the user like explained there: docs.joomla.org/Accessing_the_current_us...t#Determining_Status
Please Log in or Create an account to join the conversation.
- tanjung.technology
-
Topic Author
- Offline
Less
More
- Posts: 13
- Thank you received: 0
15 years 10 months ago #1594
by tanjung.technology
Replied by tanjung.technology on topic Re: customize visibility on 'add to cart'
I don't understand about the explanation on
docs.joomla.org/Accessing_the_current_us...t#Determining_Status
. I have opened file show.php in display->views->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.
Could you explain more about it, please? Thanks before.
Please Log in or Create an account to join the conversation.
15 years 10 months ago #1595
by nicolas
Replied by nicolas on topic Re: customize visibility on 'add to cart'
It's this code around line 60 which displays the button :
$this->row =& $this->element;
$this->setLayout('quantity');
echo $this->loadTemplate();
$this->row =& $this->element;
$this->setLayout('quantity');
echo $this->loadTemplate();
Please Log in or Create an account to join the conversation.
- tanjung.technology
-
Topic Author
- Offline
Less
More
- Posts: 13
- Thank you received: 0
15 years 10 months ago #1601
by tanjung.technology
Replied by tanjung.technology on topic Re: customize visibility on 'add to cart'
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 or Create an account to join the conversation.
15 years 10 months ago #1605
by nicolas
Replied by nicolas on topic Re: customize visibility on 'add to cart'
you should just replace the code I previously talked about by that code:
$user =& JFactory::getUser();
if (!$user->guest) {
$this->row =& $this->element;
$this->setLayout('quantity');
echo $this->loadTemplate();
}
$user =& JFactory::getUser();
if (!$user->guest) {
$this->row =& $this->element;
$this->setLayout('quantity');
echo $this->loadTemplate();
}
Please Log in or Create an account to join the conversation.
- tanjung.technology
-
Topic Author
- Offline
Less
More
- Posts: 13
- Thank you received: 0
15 years 10 months ago #1676
by tanjung.technology
Replied by tanjung.technology on topic Re: customize visibility on 'add to cart'
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->components->controllers->product.php I put code:
$user =& JFactory::getUser();
if (!$user->guest){'function update cart'}
Then, guest can't access add to cart button.
Thank you for your suggestion.
$user =& JFactory::getUser();
if (!$user->guest){'function update cart'}
Then, guest can't access add to cart button.
Thank you for your suggestion.
Please Log in or Create an account to join the conversation.
Time to create page: 0.189 seconds