Advertisement
sparkweb

Require Login Before Product View

Apr 17th, 2012
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. //Require that users are logged in before they can view any product pages (redirects to a page called "login")
  2. add_filter("foxyshop_template_redirect", "my_logged_in_users_only", 10, 2);
  3. function my_logged_in_users_only($url, $filename) {
  4.     if (!is_user_logged_in()) {
  5.         header("Location: /login/");
  6.         die;
  7.     }
  8.     return $url;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement