|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Customizer template functions. |
|
4
|
|
|
* |
|
5
|
|
|
* @package LSX Customizer |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
if ( ! function_exists( 'lsx_customizer_checkout_form_wrapper_div' ) ) { |
|
9
|
|
|
/** |
|
10
|
|
|
* Used to wrap the checkout form in a div and include navigation links |
|
11
|
|
|
* |
|
12
|
|
|
* @return void |
|
13
|
|
|
*/ |
|
14
|
|
|
function lsx_customizer_checkout_form_wrapper_div() { |
|
15
|
|
|
echo '<div class="lsx-checkout-slides">'; ?> |
|
16
|
|
|
<ul class="lsx-checkout-control-nav"> |
|
17
|
|
|
<li><a href="#"><?php esc_html_e( 'Your Details', 'lsx-customizer' ); ?></a></li> |
|
18
|
|
|
<li><a href="#"><?php esc_html_e( 'Your Order', 'lsx-customizer' ); ?></a></li> |
|
19
|
|
|
</ul> |
|
20
|
|
|
<?php |
|
21
|
|
|
} |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
if ( ! function_exists( 'lsx_customizer_close_div' ) ) { |
|
25
|
|
|
/** |
|
26
|
|
|
* Close a div |
|
27
|
|
|
* |
|
28
|
|
|
* @return void |
|
29
|
|
|
*/ |
|
30
|
|
|
function lsx_customizer_close_div() { |
|
31
|
|
|
echo '</div>'; |
|
32
|
|
|
} |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
if ( ! function_exists( 'lsx_customizer_checkout_form_wrapper' ) ) { |
|
36
|
|
|
/** |
|
37
|
|
|
* Used to wrap the checkout form in a ul |
|
38
|
|
|
* |
|
39
|
|
|
* @return void |
|
40
|
|
|
*/ |
|
41
|
|
|
function lsx_customizer_checkout_form_wrapper() { |
|
42
|
|
|
echo '<ul class="lsx-two-step-checkout">'; |
|
43
|
|
|
} |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
if ( ! function_exists( 'lsx_customizer_close_ul' ) ) { |
|
47
|
|
|
/** |
|
48
|
|
|
* Close the ul that wraps the checkout form |
|
49
|
|
|
* |
|
50
|
|
|
* @return void |
|
51
|
|
|
*/ |
|
52
|
|
|
function lsx_customizer_close_ul() { |
|
53
|
|
|
echo '</ul>'; |
|
54
|
|
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
|
|
58
|
|
|
if ( ! function_exists( 'lsx_customizer_address_wrapper' ) ) { |
|
59
|
|
|
/** |
|
60
|
|
|
* Used to wrap the address fields on the ckecout in an li |
|
61
|
|
|
* |
|
62
|
|
|
* @return void |
|
63
|
|
|
*/ |
|
64
|
|
|
function lsx_customizer_address_wrapper() { |
|
65
|
|
|
echo '<li class="lsx-customizer-addresses">'; |
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
if ( ! function_exists( 'lsx_customizer_close_li' ) ) { |
|
70
|
|
|
/** |
|
71
|
|
|
* Close an li |
|
72
|
|
|
* |
|
73
|
|
|
* @return void |
|
74
|
|
|
*/ |
|
75
|
|
|
function lsx_customizer_close_li() { |
|
76
|
|
|
echo '</li>'; |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
if ( ! function_exists( 'lsx_customizer_order_review_wrap' ) ) { |
|
81
|
|
|
/** |
|
82
|
|
|
* Used to wrap the order review in an li |
|
83
|
|
|
* |
|
84
|
|
|
* @return void |
|
85
|
|
|
*/ |
|
86
|
|
|
function lsx_customizer_order_review_wrap() { |
|
87
|
|
|
echo '<li class="order-review">'; |
|
88
|
|
|
echo '<h3 id="order_review_heading">' . esc_html__( 'Your order', 'lsx-customizer' ) . '</h3>'; |
|
89
|
|
|
} |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
if ( ! function_exists( 'lsx_customizer_fire_flexslider' ) ) { |
|
93
|
|
|
/** |
|
94
|
|
|
* Fire FlexSlider |
|
95
|
|
|
* |
|
96
|
|
|
* @return void |
|
97
|
|
|
*/ |
|
98
|
|
|
function lsx_customizer_fire_flexslider() { |
|
99
|
|
|
?> |
|
100
|
|
|
<script> |
|
101
|
|
|
jQuery( window ).load(function() { |
|
102
|
|
|
jQuery( '.lsx-checkout-slides' ).flexslider({ |
|
103
|
|
|
selector: '.lsx-two-step-checkout > li', |
|
104
|
|
|
slideshow: false, |
|
105
|
|
|
prevText: '<?php esc_html_e( 'Back to my details', 'lsx-customizer' ); ?>', |
|
106
|
|
|
nextText: '<?php esc_html_e( 'Proceed to payment', 'lsx-customizer' ); ?>', |
|
107
|
|
|
animationLoop: false, |
|
108
|
|
|
manualControls: '.lsx-checkout-control-nav li a', |
|
109
|
|
|
keyboard: false, |
|
110
|
|
|
smoothHeight: true, |
|
111
|
|
|
}); |
|
112
|
|
|
|
|
113
|
|
|
|
|
114
|
|
|
jQuery( '.flex-direction-nav a' ).removeAttr( 'href' ).addClass( 'button' ); |
|
115
|
|
|
|
|
116
|
|
|
jQuery( '.flex-direction-nav a' ).click(function() { |
|
117
|
|
|
jQuery( 'html, body' ).animate( { |
|
118
|
|
|
scrollTop: jQuery( 'form.checkout' ).offset().top |
|
119
|
|
|
}, 400 ); |
|
120
|
|
|
}); |
|
121
|
|
|
|
|
122
|
|
|
jQuery( '.flex-direction-nav a' ).on( 'touchstart', function() { |
|
123
|
|
|
jQuery( 'body' ).animate( { |
|
124
|
|
|
scrollTop: jQuery( 'form.checkout' ).offset().top |
|
125
|
|
|
}, 400 ); |
|
126
|
|
|
}); |
|
127
|
|
|
}); |
|
128
|
|
|
</script> |
|
129
|
|
|
<?php |
|
130
|
|
|
} |
|
131
|
|
|
} |
|
132
|
|
|
|