News:

Support the VirtueMart project and become a member

Main Menu

Trying to create a logout button on all pages

Started by geestring, August 09, 2013, 21:30:04 PM

Previous topic - Next topic

geestring

The following code I placed in my main template for my theme. It works as expected on virtuemart pages such as checkout, my profile... but on my home page the shopFunctionsF call breaks the page.
Can I not call shopFunctionsF anywhere? Is it possible to instantiate this class everywhere?
Is there a better alternative to what I'm doing?

<?php echo $this['modules']->render('toolbar-r');
$user JFactory::getUser();
$status $user->guest;
if (!$status == 1){
         echo shopFunctionsF::getLoginForm ($this->cartFALSE);
           }
else
        {
    if ($this['modules']->count('toolbar-login')) :
echo $this['modules']->render('toolbar-login');
endif;

        }

 ?>
</div>
<?php endif; ?>

</div>
<?php endif; ?>

theengel

Could you install it as a module instead of putting it on your template page?