-
Notifications
You must be signed in to change notification settings - Fork 1
/
returnConversionFunnelStartShortcode.php
57 lines (53 loc) · 2.09 KB
/
returnConversionFunnelStartShortcode.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
function returnConversionFunnelStartShortcode(){
if ( is_user_logged_in() ) {
echo ('
<script type="text/javascript">
window.location = "/my-account/"
</script>
');}
$shortCodeOutput = <<<SHORT_CODE_OUTPUT
<script>
jQuery('document').ready(function(){
//alert('jQuery is working');
jQuery('#returning-user-button-div').click(function(){
window.location.replace("/my-account/");
});
jQuery('#new-user-button-div').click(function(){
jQuery('#returning-user-button-div').hide();
jQuery('#new-user-button-div').hide();
jQuery('#new-user-form-div').slideDown('slow');
});
});
</script>
<div id = "returning-user-button-div" style="text-align: center; margin-bottom: 20px;">
<input style=" max-width: 200px; width: 100%; font-size: 16px;" type = "button" value = "Returning User" />
</div>
<div id = "new-user-button-div" style="text-align: center; margin-bottom: 20px;">
<input style=" max-width: 200px; width: 100%; font-size: 16px;" type = "button" value = "New User" />
</div>
<div id = "new-user-form-div" style = "display:none;">
<br />
<form method = "post">
<label for="crg_login_first_name" style="display: block; margin: 0 0 15px 0;">
<span style="width: 100px; float: left; padding-top: 2px;">First Name</span>
<input type="text" name="crg_login_first_name" />
</label>
<label for="crg_login_last_name" style="display: block; margin: 0 0 15px 0;">
<span style="width: 100px; float: left; padding-top: 2px;">Last Name</span>
<input type="text" name="crg_login_last_name" />
</label>
<label for="crg_login_phone" style="display: block; margin: 0 0 15px 0;">
<span style="width: 100px; float: left; padding-top: 2px;">Phone</span>
<input type ="text"name="crg_login_phone" />
</label>
<label for="crg_login_email" style="display: block; margin: 0 0 15px 0;">
<span style="width: 100px; float: left; padding-top: 2px;">Email</span>
<input type ="text" name="crg_login_email" />
</label>
<input style="margin-left: 100px;" type="submit" value="Submit" name="crg_login_submit" />
</form>
</div>
SHORT_CODE_OUTPUT;
return $shortCodeOutput;
}