VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: geestring on August 09, 2013, 21:30:04 PM

Title: Trying to create a logout button on all pages
Post by: geestring on August 09, 2013, 21:30:04 PM
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; ?>
Title: Re: Trying to create a logout button on all pages
Post by: theengel on August 12, 2013, 18:27:38 PM
Could you install it as a module instead of putting it on your template page?