VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: fabioweb on June 12, 2018, 21:35:51 PM

Title: Product details page only for registered user [SOLVED]
Post by: fabioweb on June 12, 2018, 21:35:51 PM
Hello, i need to block every details product page from not registered users.
Example users can display this page only if registered..
How can i do? http://casetteitalia.fabiotoscano.it/casette-in-legno-28mm/asa-detail

VM 3.2.14

Thanks
Title: Re: Product details page only for registered user
Post by: GJC Web Design on June 12, 2018, 22:26:30 PM
use a standard joomla snippet to find the user id .. if ($userid > 0){

if true continue .. if not return to the cat page
Title: Re: Product details page only for registered user
Post by: fabioweb on June 12, 2018, 22:27:38 PM
Ok if i understand correctly can i achieve this with custom code in product details page right?
Thanks
Title: Re: Product details page only for registered user
Post by: GJC Web Design on June 12, 2018, 22:30:53 PM
yep -- I would put it at the top of the products detail template over ride

you could use the same logic in a sublayouts products.php over ride to hide the links to the details if not logged in
Title: Re: Product details page only for registered user
Post by: fabioweb on June 13, 2018, 00:40:01 AM
Perfect thanks! Hope should be useful for other users.
I need to add this before:


$user=JFactory::getUser();

Thanks!