Author Topic: Show prices only to registered users  (Read 2813 times)

broc93

  • Beginner
  • *
  • Posts: 30
    • Vendita Prodotti Herbalife - DietaBenessereHL
Show prices only to registered users
« on: November 07, 2014, 11:01:23 am »
Hello. I thought I could hide prices to unregistered users by changing the "Shopper Group" in the pricing tab of each product. This way, instead of viewing the prices, they see a "Ask for the price" link.
Anyway, I don't want this to happen, products should be added to the cart regularly and anonymous users only won't see the prices on the single product pages, yet they will see the total price in their cart. How to do this?
I've looked on the forum but didn't find anything who could help me.
Thank you in advance
Herbalife products
http://dietabenesserehl.it

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28224
  • Always on vacation
    • Jenkin Hill Internet
Re: Show prices only to registered users
« Reply #1 on: November 07, 2014, 12:34:02 pm »
Use template overrides for category & product prices with a check if the user is logged in. If not logged in then hide the price display.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.28 PHP 7.4.14

broc93

  • Beginner
  • *
  • Posts: 30
    • Vendita Prodotti Herbalife - DietaBenessereHL
Re: Show prices only to registered users
« Reply #2 on: November 07, 2014, 15:18:41 pm »
Thank you! Anyway I know where to edit but not the check I should make. What should the "if" be like?
Herbalife products
http://dietabenesserehl.it

broc93

  • Beginner
  • *
  • Posts: 30
    • Vendita Prodotti Herbalife - DietaBenessereHL
Re: Show prices only to registered users
« Reply #3 on: November 24, 2014, 11:02:19 am »
Can anyone help me?
Herbalife products
http://dietabenesserehl.it

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10299
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Show prices only to registered users
« Reply #4 on: November 24, 2014, 11:29:50 am »
$user =& JFactory::getUser();
$userid = $user->get('id');
if($userid>0) {
//display prices
}
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

broc93

  • Beginner
  • *
  • Posts: 30
    • Vendita Prodotti Herbalife - DietaBenessereHL
Re: Show prices only to registered users
« Reply #5 on: November 27, 2014, 23:26:35 pm »
Thank you a lot, really! :))))
Herbalife products
http://dietabenesserehl.it