Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Require Login Before Product View

sparkweb Apr 17th, 2012 121 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top