{"id":5698,"date":"2017-04-14T02:18:57","date_gmt":"2017-04-14T09:18:57","guid":{"rendered":"http:\/\/digitalaccesspass.com\/doc\/?p=5698"},"modified":"2020-05-29T19:15:20","modified_gmt":"2020-05-30T02:15:20","slug":"1-click-member-registration","status":"publish","type":"post","link":"http:\/\/digitalaccesspass.com\/doc\/1-click-member-registration\/","title":{"rendered":"1-Click Member Registration"},"content":{"rendered":"<p style=\"font-size: 20px; margin-bottom: -5px !important; margin-top: -5px !important;\"><span>1-Click Signup For Logged-In Members<\/span><\/p>\n<p>Here are the steps to allow your &#8220;logged-in&#8221; members to signup for your free products with the click on a button, without having to enter their name, email etc.<\/p>\n<h3><span>STEP 1: &nbsp;Create your Free Product in DAP&nbsp;<\/span><\/h3>\n<ul style=\"margin-bottom: 0px !important;\">\n<li style=\"margin-bottom: -10px !important;\">Visit DAP admin &gt;&gt; products page.<\/li>\n<\/ul>\n<ul style=\"margin-bottom: 0px !important;\">\n<li style=\"margin-bottom: -10px !important;\">In the Billing &amp; Access tab, set product type to FREE, and set &#8220;Allow Free Signup&#8221; to &#8220;Y&#8221;.<\/li>\n<\/ul>\n<p><span style=\"width: 100%;\"><img loading=\"lazy\" alt=\"\" width=\"948\" height=\"591\" src=\"\/\/digitalaccesspass.com\/images\/freesignup.png\" style=\"width: 100%;\"\/><\/span><\/p>\n<h3><span>STEP 1: &nbsp;P<\/span>ublish&nbsp;this Free Signup Code in your Members Area<\/h3>\n<p>&lt;div id=&#8221;stylized&#8221;&gt;&lt;form id=&#8221;dap_direct_signup&#8221; name=&#8221;dap_direct_signup&#8221; method=&#8221;post&#8221; action=&#8221;http:\/\/yoursite.com\/dap\/signup_submit_members.php&#8221;&gt; &lt;button type=&#8221;submit&#8221;&gt;Sign Up&lt;\/button&gt;&lt;input type=&#8221;hidden&#8221; name=&#8221;productId&#8221; value=&#8221;1&#8243; \/&gt;&lt;input type=&#8221;hidden&#8221; name=&#8221;redirect&#8221; value=&#8221;\/login&#8221; \/&gt;&lt;\/form&gt;&lt;\/div&gt;<\/p>\n<ul style=\"margin-bottom: 0px !important;\">\n<li style=\"margin-bottom: -10px !important;\">Enter this code in WP &#8220;Text&#8221; editor.<\/li>\n<\/ul>\n<ul style=\"margin-bottom: 0px !important;\">\n<li>Replace &#8220;yoursite.com&#8221; with your domain name.<\/li>\n<li style=\"margin-bottom: -10px !important;\">Replace the value of the &#8220;productId&#8221; tag with your DAP product Id.<\/li>\n<\/ul>\n<ul>\n<li>Replace the value of &#8220;redirect&#8221; tag &nbsp;with the URL of the page where you want users redirected after they signup.<\/li>\n<\/ul>\n<h3><span>STEP 3: &nbsp;Create a free signup script and upload to the &#8220;dap&#8221; folder on your site<\/span>:<\/h3>\n<ul style=\"margin-bottom: 0px !important;\">\n<li>Create a file called <span>&#8220;signup_submit_members.php<\/span>&#8220;.<\/li>\n<li style=\"margin-bottom: -10px !important;\">Add the following lines of code to this file:<\/li>\n<\/ul>\n<p>&lt;?php include_once (&#8220;dap-config.php&#8221;);$autoLogin = isset($_REQUEST[&#8216;autoLogin&#8217;]) ? $_REQUEST[&#8216;autoLogin&#8217;] : &#8220;Y&#8221;;if( !Dap_Session::isLoggedIn() ) {header(&#8220;Location:&#8221; . Dap_Config::get(&#8220;LOGIN_URL&#8221;));exit;}$session = Dap_Session::getSession();$user = $session-&gt;getUser();$user = Dap_User::loadUserById($user-&gt;getId());if(isset($user)) {$_REQUEST[&#8220;first_name&#8221;]=$user-&gt;getFirst_name(); $_REQUEST[&#8220;email&#8221;]=$user-&gt;getEmail();$_REQUEST[&#8220;last_name&#8221;]=$user-&gt;getLast_name(); $productId = $_REQUEST[&#8220;productId&#8221;];logToFile(&#8220;registerUser: productId=&#8221; . $productId);registerUser(&#8220;signup_submit_members&#8221;,$autoLogin, $productId);}else {header(&#8220;Location:&#8221;.Dap_Config::get(&#8220;LOGIN_URL&#8221;));exit;}return;?&gt;<\/p>\n<ul style=\"margin-bottom: 0px !important;\">\n<li>Save the file<\/li>\n<li style=\"margin-bottom: -10px !important;\">Upload it to the &#8220;<span>dap<\/span>&#8221; folder on your site.<\/li>\n<\/ul>\n<h3><span>STEP 4: &nbsp;Make sure that the signup button is only visible to the logged-in members<\/span><\/h3>\n<p>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&#8217;t already have access to the free product.<\/p>\n<p style=\"margin-bottom: 0px !important;\">For e.g. &nbsp;<\/p>\n<p>If you want to show the 1-click signup&nbsp;button to only logged-in members that don&#8217;t already have access to product Id = 1, you can use this shortcode:<\/p>\n<p style=\"margin-bottom: 0px !important;\"><span>[DAP hasNoAccessTo=&#8221;1&#8243; isLoggedIn=&#8221;Y&#8221;] <\/span><\/p>\n<p style=\"margin-bottom: 0px !important;\">&lt;div id=&#8221;stylized&#8221;&gt;&lt;form id=&#8221;dap_direct_signup&#8221; name=&#8221;dap_direct_signup&#8221; method=&#8221;post&#8221; action=&#8221;http:\/\/yoursite.com\/dap\/signup_submit_members.php&#8221;&gt; &lt;button type=&#8221;submit&#8221;&gt;Sign Up&lt;\/button&gt;&lt;input type=&#8221;hidden&#8221; name=&#8221;productId&#8221; value=&#8221;1&#8243; \/&gt;&lt;input type=&#8221;hidden&#8221; name=&#8221;redirect&#8221; value=&#8221;\/login&#8221; \/&gt;&lt;\/form&gt;&lt;\/div&gt;&nbsp;<\/p>\n<p><span>[\/DAP]<\/span><\/p>\n<h3><span>STEP 5: Test to make sure everything works as expected<\/span><\/h3>\n<p style=\"margin-bottom: 0px !important;\">Login as a user.<\/p>\n<p style=\"margin-bottom: 0px !important;\">Visit the signup page. <\/p>\n<p style=\"margin-bottom: 0px !important;\">See if the 1-click button is visible. <\/p>\n<p style=\"margin-bottom: 0px !important;\">Click on the button to signup. <\/p>\n<p style=\"margin-bottom: 0px !important;\">Upon signup, you should receive access to the free product.&nbsp;<\/p>\n<p style=\"margin-bottom: 0px !important;\">If your product is single opt-in, upon signup, the users will be automatically logged-in as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1-Click Signup For Logged-In Members Here are the steps to allow your &#8220;logged-in&#8221; members to signup for your free products with the click on a button, without having to enter their name, email etc. STEP 1: &nbsp;Create your Free Product in DAP&nbsp; Visit DAP admin &gt;&gt; products page. In the Billing &amp; Access tab, set [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/posts\/5698"}],"collection":[{"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/comments?post=5698"}],"version-history":[{"count":37,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/posts\/5698\/revisions"}],"predecessor-version":[{"id":6220,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/posts\/5698\/revisions\/6220"}],"wp:attachment":[{"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/media?parent=5698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/categories?post=5698"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/digitalaccesspass.com\/doc\/wp-json\/wp\/v2\/tags?post=5698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}