Advertisement
sparkweb

FoxyShop: Password Protect a Product

Dec 27th, 2011
667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. //Place this code in the foxyshop-single-product.php template file immediate after this line:
  2. //while (have_posts()) : the_post();
  3.  
  4.  
  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.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement