Please HELP - Virtuemart 3 hide cart button for not logged user

WebIm
40 Posts
WebIm posted this 26 April 2020

Hello,
I would like to hide the "add to cart" button from unregistered and unregistered users on the product detail page.
In virtuemart 3, how do I do it?
Can you help me?
thanks

Hello, I would like to hide the "add to cart" button from unregistered and unregistered users on the product detail page. In virtuemart 3, how do I do it? Can you help me? thanks
Vote to pay developers attention to this features or issue.
1 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 13 May 2020

Hello,

I am very sorry for such a delay, please, try adding this code to Home -> Settings -> CMS Code:

<?php 
                $user = JFactory::getUser();
                if($user->id <= 0):
           ?>
        <style type="text/css" media="screen">
        .addtocart-area, .bd-cartlink-2, bd-cartlink-*, .add_to_cart_button { display:none;}
        </style>

       <?php endif; ?>

Gina
Themler Support

Hello, I am very sorry for such a delay, please, try adding this code to Home -> Settings -> CMS Code: <?php $user = JFactory::getUser(); if($user->id <= 0): ?> <style type="text/css" media="screen"> .addtocart-area, .bd-cartlink-2, bd-cartlink-*, .add_to_cart_button { display:none;} </style> <?php endif; ?> Gina Themler Support
You must log in or register to leave comments