VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: extonjaez on December 07, 2016, 12:24:09 PM

Title: i would like to display a VM page only to registred users.
Post by: extonjaez on December 07, 2016, 12:24:09 PM
Hello,

Today this URL page of my site is displayed to the public users
https://www.ignition.ws/component/virtuemart/by,%60p%60.product_sku/dirDesc/results,21-70?Itemid=0
And i would like to display this page only to registred users.
Which change i must do and where ?
(because my VM Component is Linked to a Menu Item with registred Group assigned (then i don't understand zhy the Urlis public...), see this picture joint :
http://www.screencast.com/users/extonjaez/folders/Default/media/a6f0e5fe-bb23-4e44-b7bd-7577ea28fe98
Many Thanks for your help
Arnaud




System Information
VirtueMart 3.0.18.5
PHP Built On    Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
Database Version    5.1.73-1+deb6u1
Database Collation    latin1_swedish_ci
Database Connection Collation    utf8_general_ci
PHP Version    5.5.38
Web Server    Apache
WebServer to PHP Interface    cgi-fcgi
Joomla! Version    Joomla! 3.6.4 Stable [ Noether ] 21-October-2016 16:33 GMT
Joomla! Platform Version    Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent    Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Title: Re: i would like to display a VM page only to registred users.
Post by: K&K media production on December 07, 2016, 18:04:24 PM
make template overrides for category, productdetails, ...

add this to the top of the files:

$user = JFactory::getUser();
if ($user->guest) {
     $message = "YOUR ERROR MESSAGE";
     JFactory::getApplication()->redirect("index.php", $message, "error");
}
Title: Re: i would like to display a VM page only to registred users.
Post by: extonjaez on December 07, 2016, 21:49:30 PM
Quote from: K&K media production on December 07, 2016, 18:04:24 PM
make template overrides for category, productdetails, ...

add this to the top of the files:

$user = JFactory::getUser();
if ($user->guest) {
     $message = "YOUR ERROR MESSAGE";
     JFactory::getApplication()->redirect("index.php", $message, "error");
}


At the top of which files ?
Many Thanks for your help
Best Regards
Arnaud
Title: Re: i would like to display a VM page only to registred users.
Post by: GJC Web Design on December 07, 2016, 23:26:20 PM
over ride the default.php of each of the views mentioned and add the code
Title: Re: i would like to display a VM page only to registred users.
Post by: Studio 42 on December 08, 2016, 16:50:42 PM
Hi extonjaez,
Le prpbleme est que vous avez une langue, il faut faire de même pour toutes les langues.
The URL https://www.ignition.ws/component/virtuemart/by,%60p%60.product_sku/dirDesc/results,21-70?Itemid=0 is because this is the english result and you have set only for french the menu links.
Try to add link to shop root and/or category "0" for all language with register restriction and the shop should be protected from anonymous access(products and manufacturer view too).