Giving only registered users access to the shopping cart?

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Jan 31, 2013 12:51 pm
Reply with quote
Report this post
I would like to allow ONLY registered users of my site to access the shopping cart, which you reach by clicking on MY CART > SHOW CART.

How can I achieve this?

Thx
User avatar
Gold Boarder

Konrad M
Thu Jan 31, 2013 1:49 pm
Reply with quote
Report this post
Hi,
please go to layouts/default.php and find:
Code: Select all
<?php if($this->API->modules('cart')) : ?>
             <a href="index.php?option=com_virtuemart&amp;view=cart" id="btnCart"><?php echo JText::_('TPL_GK_LANG_MY_CART'); ?><span><?php echo JText::_('TPL_GK_LANG_MY_CART_LOADING'); ?></span></a>
             <?php endif; ?>

and change it to:
Code: Select all
<?php if($this->API->modules('cart') && $userID!= 0) : ?>
             <a href="index.php?option=com_virtuemart&amp;view=cart" id="btnCart"><?php echo JText::_('TPL_GK_LANG_MY_CART'); ?><span><?php echo JText::_('TPL_GK_LANG_MY_CART_LOADING'); ?></span></a>
             <?php endif; ?>
User avatar

GK User
Thu Jan 31, 2013 6:20 pm
Reply with quote
Report this post
Konrad, thanks for providing this.

I didn't want to stop the user from viewing the modal cart that you have provided code to prevent access to.

Instead, I want to stop the user being able to access the cart page with checkout details.
How can I do that?

Thank you so much for all your help
User avatar
Gold Boarder

Konrad M
Fri Feb 01, 2013 6:17 am
Reply with quote
Report this post
Unfortunetly it is a question for Virtuemart community support. Becasue we only change look of VM templates not behavior.
User avatar


cron