FoxyShop: Password Protect a Product

sparkweb Dec 27th, 2011 198 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Place this code in the foxyshop-single-product.php template file immediate after this line:
  2. //while (have_posts()) : the_post();
  5.         //Check For Post Required
  6.         if (post_password_required()) {
  7.                 ?>
  8.                 <form method="post" action="<?php bloginfo("wpurl"); ?>/wp-login.php?action=postpass">
  9.                 <p>This product is password protected. To view it please enter your password below:</p>
  10.                 <label for="pwbox-531">Password: </label>
  11.                 <input type="password" size="20" id="pwbox-531" name="post_password"/>
  12.                 <input type="submit" value="Submit" name="Submit" class="foxyshop_button" style="float: none;" />
  13.                 </form>
  14.                 <?php          
  15.                 break;
  16.         }
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