Author Topic: Product details page only for registered user [SOLVED]  (Read 133 times)

fabioweb

  • Jr. Member
  • **
  • Posts: 128
Product details page only for registered user [SOLVED]
« 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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7725
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Product details page only for registered user
« Reply #1 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fabioweb

  • Jr. Member
  • **
  • Posts: 128
Re: Product details page only for registered user
« Reply #2 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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7725
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Product details page only for registered user
« Reply #3 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

fabioweb

  • Jr. Member
  • **
  • Posts: 128
Re: Product details page only for registered user
« Reply #4 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!