Ad to cart button only for logged in users.
I have found some solutions like adding joomlas getUser code in front of Add To Cart Button code in /components/com_virtuemart/views/productdetails/tmpl/default.php around line 200. This seams to work for all people but not me. It might be because of the template. Can you help me with this.
Codes im trying to use are;
<?php
// check if user is logged in/registered.
$user =& JFactory::getUser(); if( $user->id ){
// Add To Cart Button
...
and
<?php
// check if user is logged in/registered.
// $user =& JFactory::getUser(); if( $user->id ){
$user = JFactory::getUser();
$status = $user->guest;
if($status == 1){
echo "some text";
}
else
{
// Add To Cart Button
...
Both apparently work for others.
Thank you in advance.