News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Product details page only for registered user [SOLVED]

Started by fabioweb, June 12, 2018, 21:35:51 PM

Previous topic - Next topic

fabioweb

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

GJC Web Design

use a standard joomla snippet to find the user id .. if ($userid > 0){

if true continue .. if not return to the cat page
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fabioweb

Ok if i understand correctly can i achieve this with custom code in product details page right?
Thanks

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fabioweb

Perfect thanks! Hope should be useful for other users.
I need to add this before:


$user=JFactory::getUser();

Thanks!