News:

Looking for documentation? Take a look on our wiki

Main Menu

If user logged in cart page

Started by fabioweb, October 29, 2016, 20:52:41 PM

Previous topic - Next topic

fabioweb

hello,
i'm trying to check if user is logged in in cart page so in com_virtuemart->cart->default.php i wrote this test code:


<?php if($user->id != 0) { ?>
loggedIn
<?php  } else { ?>
Not Logged In
<?php ?>


but Logged in or not logged in i get always else condition .. Why?

Regards


kishoreonwork

Hello ,

Try something like this

<?php 
$user
=JFactory::getUser();
if(
$user->id>0){ ?>

loggedIn
<?php  } else { ?>
Not Logged In
<?php ?>


Thanks
Kishore
I am available for paid joomla and virtuemart consulting.
http://www.kishoreweblabs.com/
skype kishore2607