1 | <?php |
||
2 | /** |
||
3 | * Customizer template functions. |
||
4 | * |
||
5 | * @package LSX Customizer |
||
6 | */ |
||
7 | |||
8 | if ( ! function_exists( 'lsx_customizer_checkout_form_wrapper_div' ) ) { |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
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() { |
||
0 ignored issues
–
show
|
|||
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 | } |
||
0 ignored issues
–
show
|
|||
22 | } |
||
23 | |||
24 | if ( ! function_exists( 'lsx_customizer_close_div' ) ) { |
||
0 ignored issues
–
show
|
|||
25 | /** |
||
26 | * Close a div |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | function lsx_customizer_close_div() { |
||
0 ignored issues
–
show
|
|||
31 | echo '</div>'; |
||
32 | } |
||
0 ignored issues
–
show
|
|||
33 | } |
||
34 | |||
35 | if ( ! function_exists( 'lsx_customizer_checkout_form_wrapper' ) ) { |
||
0 ignored issues
–
show
|
|||
36 | /** |
||
37 | * Used to wrap the checkout form in a ul |
||
38 | * |
||
39 | * @return void |
||
40 | */ |
||
41 | function lsx_customizer_checkout_form_wrapper() { |
||
0 ignored issues
–
show
|
|||
42 | echo '<ul class="lsx-two-step-checkout">'; |
||
43 | } |
||
0 ignored issues
–
show
|
|||
44 | } |
||
45 | |||
46 | if ( ! function_exists( 'lsx_customizer_close_ul' ) ) { |
||
0 ignored issues
–
show
|
|||
47 | /** |
||
48 | * Close the ul that wraps the checkout form |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | function lsx_customizer_close_ul() { |
||
0 ignored issues
–
show
|
|||
53 | echo '</ul>'; |
||
54 | } |
||
0 ignored issues
–
show
|
|||
55 | } |
||
56 | |||
57 | |||
58 | if ( ! function_exists( 'lsx_customizer_address_wrapper' ) ) { |
||
0 ignored issues
–
show
|
|||
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() { |
||
0 ignored issues
–
show
|
|||
65 | echo '<li class="lsx-customizer-addresses">'; |
||
66 | } |
||
0 ignored issues
–
show
|
|||
67 | } |
||
68 | |||
69 | if ( ! function_exists( 'lsx_customizer_close_li' ) ) { |
||
0 ignored issues
–
show
|
|||
70 | /** |
||
71 | * Close an li |
||
72 | * |
||
73 | * @return void |
||
74 | */ |
||
75 | function lsx_customizer_close_li() { |
||
0 ignored issues
–
show
|
|||
76 | echo '</li>'; |
||
77 | } |
||
0 ignored issues
–
show
|
|||
78 | } |
||
79 | |||
80 | if ( ! function_exists( 'lsx_customizer_order_review_wrap' ) ) { |
||
0 ignored issues
–
show
|
|||
81 | /** |
||
82 | * Used to wrap the order review in an li |
||
83 | * |
||
84 | * @return void |
||
85 | */ |
||
86 | function lsx_customizer_order_review_wrap() { |
||
0 ignored issues
–
show
|
|||
87 | echo '<li class="order-review">'; |
||
88 | echo '<h3 id="order_review_heading">' . esc_html__( 'Your order', 'lsx-customizer' ) . '</h3>'; |
||
89 | } |
||
0 ignored issues
–
show
|
|||
90 | } |
||
91 | |||
92 | if ( ! function_exists( 'lsx_customizer_fire_flexslider' ) ) { |
||
0 ignored issues
–
show
|
|||
93 | /** |
||
94 | * Fire FlexSlider |
||
95 | * |
||
96 | * @return void |
||
97 | */ |
||
98 | function lsx_customizer_fire_flexslider() { |
||
0 ignored issues
–
show
|
|||
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 | } |
||
0 ignored issues
–
show
|
|||
131 | } |
||
132 |