VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: broc93 on November 07, 2014, 11:01:23 AM

Title: Show prices only to registered users
Post by: broc93 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
Title: Re: Show prices only to registered users
Post by: jenkinhill 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.
Title: Re: Show prices only to registered users
Post by: broc93 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?
Title: Re: Show prices only to registered users
Post by: broc93 on November 24, 2014, 11:02:19 AM
Can anyone help me?
Title: Re: Show prices only to registered users
Post by: GJC Web Design on November 24, 2014, 11:29:50 AM
$user =& JFactory::getUser();
$userid = $user->get('id');
if($userid>0) {
//display prices
}
Title: Re: Show prices only to registered users
Post by: broc93 on November 27, 2014, 23:26:35 PM
Thank you a lot, really! :))))