Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple Shopping Cart Tweaks › Automatically require users to be logged in? › Reply To: Automatically require users to be logged in?
Yeah this should be easy to implement. All you gotta do is check if the visitor is logged in when they hit the “Add to Cart” button. If they are logged in then let them process as usual or else redirect them to the Login page.
Search for the following piece of line in the code (this is what gets executed when the button is clicked:
You will need to add the check for
is_user_logged_in() inside this if statement block and redirect to the login page if the user is not logged in.