1-Click Member Registration
1-Click Signup For Logged-In Members
Here are the steps to allow your "logged-in" members to signup for your free products with the click on a button, without having to enter their name, email etc.
STEP 1: Create your Free Product in DAP
- Visit DAP admin >> products page.
- In the Billing & Access tab, set product type to FREE, and set "Allow Free Signup" to "Y".
STEP 1: Publish this Free Signup Code in your Members Area
<div id="stylized" class="dap_direct_signup_form"><form id="dap_direct_signup" name="dap_direct_signup" method="post" action="http://yoursite.com/dap/signup_submit_members.php"> <button type="submit">Sign Up</button><input type="hidden" name="productId" value="1" /><input type="hidden" name="redirect" value="/login" /></form></div>
- Enter this code in WP "Text" editor.
- Replace "yoursite.com" with your domain name.
- Replace the value of the "productId" tag with your DAP product Id.
- Replace the value of "redirect" tag with the URL of the page where you want users redirected after they signup.
STEP 3: Create a free signup script and upload to the "dap" folder on your site:
- Create a file called "signup_submit_members.php".
- Add the following lines of code to this file:
<?php
include_once ("dap-config.php");
$autoLogin = isset($_REQUEST['autoLogin']) ? $_REQUEST['autoLogin'] : "Y";
if( !Dap_Session::isLoggedIn() ) {
header("Location:" . Dap_Config::get("LOGIN_URL"));
exit;
}
$session = Dap_Session::getSession();
$user = $session->getUser();
$user = Dap_User::loadUserById($user->getId());
if(isset($user)) {
$_REQUEST["first_name"]=$user->getFirst_name();
$_REQUEST["email"]=$user->getEmail();
$_REQUEST["last_name"]=$user->getLast_name();
$productId = $_REQUEST["productId"];
logToFile("registerUser: productId=" . $productId);
registerUser("signup_submit_members",$autoLogin, $productId);
}
else {
header("Location:".Dap_Config::get("LOGIN_URL"));
exit;
}
return;
?>
- Save the file
- Upload it to the "dap" folder on your site.
STEP 4: Make sure that the signup button is only visible to the logged-in members
You can use the DAP shortcode (or protect the signup page in DAP) to make sure that the signup button only visible to logged-in members that don't already have access to the free product.
For e.g.
If you want to show the 1-click signup button to only logged-in members that don't already have access to product Id = 1, you can use this shortcode:
[DAP hasNoAccessTo="1" isLoggedIn="Y"]
<div id="stylized" class="dap_direct_signup_form"><form id="dap_direct_signup" name="dap_direct_signup" method="post" action="http://yoursite.com/dap/signup_submit_members.php"> <button type="submit">Sign Up</button><input type="hidden" name="productId" value="1" /><input type="hidden" name="redirect" value="/login" /></form></div>
[/DAP]
STEP 5: Test to make sure everything works as expected
Login as a user.
Visit the signup page.
See if the 1-click button is visible.
Click on the button to signup.
Upon signup, you should receive access to the free product.
If your product is single opt-in, upon signup, the users will be automatically logged-in as well.