55b048e6 by Jeff Balicki

wpsl

1 parent f7597746
...@@ -31,18 +31,22 @@ add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3); ...@@ -31,18 +31,22 @@ add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3);
31 31
32 32
33 add_action('publish_wpsl_stores','send_notification_for_publish_project',10,1); 33 add_action('publish_wpsl_stores','send_notification_for_publish_project',10,1);
34 function send_notification_for_publish_project( $post_id ) {
35 $email = get_post_meta($post_id, 'wpsl_email', true);
36 $subject = 'WYN Registration Aproved';
37 $message = file_get_contents('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/inc/Registration-Acceptance.html');
38 34
39 $headers_customer = array('Content-Type: text/html; charset=UTF-8'); 35 function send_notification_for_publish_project( $post_id ) {
40 wp_mail( $email , $subject, $message, $headers_customer); 36 update_post_meta($post_id, 'wpsl_country', 'CA');
37 delete_autoload_map_transient();
38 $email = get_post_meta($post_id, 'wpsl_email', true);
39 $subject = 'WYN Registration Aproved';
40 $message = file_get_contents('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/inc/Registration-Acceptance.html');
41
42 $headers_customer = array('Content-Type: text/html; charset=UTF-8');
43 wp_mail( $email , $subject, $message, $headers_customer);
41 44
42 } 45 }
43 46
44 47
45 add_action( 'trash_wpsl_stores', 'send_notification_for_delete_project' ,10,1); 48 add_action( 'trash_wpsl_stores', 'send_notification_for_delete_project' ,10,1);
49
46 function send_notification_for_delete_project( $post_id ) { 50 function send_notification_for_delete_project( $post_id ) {
47 $email = get_post_meta($post_id, 'wpsl_email', true); 51 $email = get_post_meta($post_id, 'wpsl_email', true);
48 $subject = 'WYN Registration Denied'; 52 $subject = 'WYN Registration Denied';
......
...@@ -87,3 +87,73 @@ function custom_meta_box_fields2( $meta_fields ) { ...@@ -87,3 +87,73 @@ function custom_meta_box_fields2( $meta_fields ) {
87 87
88 return $meta_fields; 88 return $meta_fields;
89 } 89 }
90
91
92 add_filter('wpsl_templates', 'custom_templates');
93
94 function custom_templates($templates)
95 {
96
97 $templates[] = array(
98 'id' => 'store',
99 'name' => 'Custom store template',
100 'path' => get_stylesheet_directory() . '/' . 'wpsl-templates/store-listings-map-left.php',
101 );
102
103
104 return $templates;
105 }
106
107 add_filter('wpsl_listing_template', 'custom_listing_template');
108
109 function custom_listing_template()
110 {
111
112 global $wpsl, $wpsl_settings;
113
114 include( get_stylesheet_directory() . '/' . 'wpsl-templates/store-listings.php');
115
116 return $listing_template;
117 }
118
119 add_filter('wpsl_store_header_template', 'custom_store_header_template');
120
121 function custom_store_header_template()
122 {
123
124 $header_template = '<% if ( wpslSettings.storeUrl == 1 && url ) { %>' . "\r\n";
125 $header_template .= '<a href="<%= url %>" target="_blank" class="placelink"><%= store %></a>' . "\r\n";
126
127 $header_template .= '<% } else { %>' . "\r\n";
128 $header_template .= '<%= store %>' . "\r\n";
129 $header_template .= '<% } %>';
130
131 return $header_template;
132 }
133
134 add_filter( 'wpsl_info_window_template', 'custom_info_window_template' );
135
136 function custom_info_window_template() {
137
138
139 include( get_stylesheet_directory() . '/' . 'wpsl-templates/store-custom_more_info.php');
140
141
142 return $info_window_template;
143
144 }
145
146
147 function delete_autoload_map_transient()
148 {
149 global $wpdb;
150
151 $option_names = $wpdb->get_results("SELECT option_name AS transient_name FROM " . $wpdb->options . " WHERE option_name LIKE ('\_transient\_wpsl\_autoload\_%')");
152
153 if ($option_names) {
154 foreach ($option_names as $option_name) {
155 $transient_name = str_replace("_transient_", "", $option_name->transient_name);
156 delete_transient($transient_name);
157 }
158 }
159 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -37,6 +37,13 @@ jQuery( document ).ready(function($) { ...@@ -37,6 +37,13 @@ jQuery( document ).ready(function($) {
37 }, 500); 37 }, 500);
38 38
39 }); 39 });
40 $(document).on("submit","#wpsl-form",function() {
41 console.log('ssssss');
42 $('#wpsl-result-list').show();
43 $('#wpsl-gmap').show();
44 });
45
46
40 47
41 $( "#register-here" ).on( "keydown", function(event) { 48 $( "#register-here" ).on( "keydown", function(event) {
42 if(event.which == 13){ 49 if(event.which == 13){
......
1 <?php
2
3 global $wpsl_settings, $wpsl;
4
5 $info_window_template = '<div data-store-id="<%= id %>" class="wpsl-info-window">' . "\r\n";
6 $info_window_template .= "\t\t" . '<p>' . "\r\n";
7 $info_window_template .= "\t\t\t" . wpsl_store_header_template() . "\r\n";
8 $info_window_template .= "\t\t\t" . '<span><%= address %></span>' . "\r\n";
9 $info_window_template .= "\t\t\t" . '<% if ( address2 ) { %>' . "\r\n";
10 $info_window_template .= "\t\t\t" . '<span><%= address2 %></span>' . "\r\n";
11 $info_window_template .= "\t\t\t" . '<% } %>' . "\r\n";
12 $info_window_template .= "\t\t\t" . '<span>' . wpsl_address_format_placeholders() . '</span>' . "\r\n";
13 $info_window_template .= "\t\t" . '</p>' . "\r\n";
14
15 $info_window_template .= "\t\t" . '<% if ( phone ) { %>' . "\r\n";
16 $info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'phone_label', __( 'Phone', 'wpsl' ) ) ) . '</strong>: <a href="tel:<%= formatPhoneNumber( phone ) %>"><%= formatPhoneNumber( phone ) %></a></span>' . "\r\n";
17 $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
18 $info_window_template .= "\t\t" . '<% if ( email ) { %>' . "\r\n";
19 $info_window_template .= "\t\t" . '<span><strong>' . esc_html( $wpsl->i18n->get_translation( 'email_label', __( 'Email', 'wpsl' ) ) ) . '</strong>: <a herf="mailto:<%= formatEmail( email ) %>"><%= formatEmail( email ) %></span>' . "\r\n";
20 $info_window_template .= "\t\t" . '<% } %>' . "\r\n";
21 $info_window_template .= '<br><br>';
22
23
24
25
1 <?php
2 global $wpsl_settings, $wpsl;
3
4 $output = $this->get_custom_css();
5 $autoload_class = ( !$wpsl_settings['autoload'] ) ? 'class="wpsl-not-loaded"' : '';
6
7 $output .= '<div id="wpsl-wrap">' . "\r\n";
8 $output .= "\t" . '<div class="wpsl-search wpsl-clearfix ' . $this->get_css_classes() . '">' . "\r\n";
9 $output .= "\t\t" . '<div id="wpsl-search-wrap">' . "\r\n";
10 $output .= "\t\t\t\t" . '<label id="label-search-input" for="wpsl-search-input">SEARCH BY POSTAL CODE:</label>';
11 $output .= "\t\t\t" . '<form id="wpsl-form" autocomplete="off">' . "\r\n";
12 $output .= "\t\t\t" . '<div class="wpsl-input">' . "\r\n";
13 $output .= "\t\t\t\t" . '<input id="wpsl-search-input" type="text" value="' . apply_filters( 'wpsl_search_input', '' ) . '" name="wpsl-search-input" placeholder="A1A 2B2" aria-required="true" />' . "\r\n";
14 $output .= "\t\t\t\t" . '<input id="wpsl-search-btn" type="submit" value="' . esc_attr( $wpsl->i18n->get_translation( 'search_btn_label', __( 'Search', 'wpsl' ) ) ) . '">' . "\r\n";
15
16 $output .= "\t\t\t\t" . '</div>' . "\r\n";
17 $output .= "\t\t\t\t" . '</div>' . "\r\n";
18 $output .= "\t\t" . '</form>' . "\r\n";
19 $output .= "\t\t\t" . '</div>' . "\r\n";
20
21 $output .= "\t" . '<div id="wpsl-result-list">' . "\r\n";
22 $output .= "\t\t\t" . '<strong>SEARCH RESULTS</strong>' . "\r\n";
23 $output .= "\t\t\t" . '<br/>Select the financial planner most convenient to you:<br/><br/>' . "\r\n";
24
25 $output .= "\t\t" . '<div id="wpsl-stores" '. $autoload_class .'>' . "\r\n";
26 $output .= "\t\t\t" . '<ul></ul>' . "\r\n";
27 $output .= "\t\t" . '</div>' . "\r\n";
28
29 $output .= "\t" . '</div>' . "\r\n";
30 $output .= "\t" . '<div id="wpsl-gmap" class="wpsl-gmap-canvas full"></div>' . "\r\n";
31
32 $output .= '</div>' . "\r\n";
33 $output .= '<style>
34 #wpsl-category{
35 margin-top: 30px;
36 float:right !important;
37
38 }
39 #label-search-input{
40
41 display: inline-block;
42 text-align: unset;
43 overflow: hidden;
44 }
45 #wpsl-category label{
46 width: 100px !important;
47 text-transform: none;
48 loat: unset !important;
49 display: inline-block !important;
50 width: 115px !important;
51 padding-left: 10px;
52 vertical-align: middle;
53 }
54 .results_row_top{
55 background :transparent !important;
56 }
57 .wpsl-search{
58 margin-bottom: 12px;
59 padding: 0px;
60 background: #fff !important;
61 }
62
63 .broker_radio{
64 disply:none !important;
65 }
66 #wpsl-gmap,
67 #wpsl-result-list{
68 width:48.5%;
69 height:400px !important;
70 display: inline-block;
71 float:left;
72 font-size:18px;
73
74
75 }
76
77 #wpsl-stores{
78 height: 330px !important;
79 }
80 #wpsl-gmap{
81 width:48.5%;
82 float:right;
83 position: absolute;
84 margin-left: 0%;
85 transition:0.5s;
86 transition-delay:3s;
87 margin-left: 20px;
88
89 }
90 #wpsl-gmap.full{
91 position: absolute;
92 width: 50%;
93 overflow: hidden;
94 margin-left: 0%;
95 transition:0.5s;
96 transition-delay:3s;
97
98 }
99 .location_distance{
100 display:none !important;
101 float: none !important;
102 }
103 #wpsl-wrap #wpsl-result-list li {
104 border-top: 1px solid #ccc;
105 border-bottom: 0px solid #ccc;
106 font-size:14px;
107
108 padding: 0px;
109 }
110 #wpsl-wrap #wpsl-result-list li a{
111 color:#007DB3;
112 text-decoration: none;
113 }
114 #wpsl-wrap #wpsl-result-list li a:hover{
115 color:#000;
116 text-decoration: underline;
117 }
118
119 .location_link{
120 float: right;
121 width: 0%;
122 }
123 @media (max-width: 767px){
124 #wpsl-gmap.full{
125 position: relative;
126 width: 50%;
127 height: 400px !important;
128 float: none;
129 display: block;
130 margin-left: 0%;
131 margin-top: 100px;
132 }
133
134 }
135 @media (max-width: 767px){
136 #wpsl-gmap,
137 #wpsl-result-list{
138 width:50%;
139 height:400px !important;
140 float:none;
141 display:block;
142 }
143
144 }
145 #wpsl-search-btn {
146 display:none !important;
147 }
148 td, th {
149
150 vertical-align: top;
151 }
152 #wpsl-search-input{
153 border: 0px solid #a4a5a8;
154 border-bottom: 2px solid #000;
155 background-color: #F1F7E6;
156 color:#54565A;
157 }
158 #wpsl-search-input::-webkit-input-placeholder { /* Edge */
159 color: #949598;
160 font-family: "HelveticaNeue";
161 }
162
163 #wpsl-search-input:-ms-input-placeholder { /* Internet Explorer 10-11 */
164 color: #949598;
165 font-family: "HelveticaNeue";
166 }
167
168 #wpsl-search-input::placeholder {
169 color: #949598;
170 font-family: "HelveticaNeue";
171 }
172 #wpsl-search-btn, #wpsl-search-wrap div{
173 margin-right: 10px;
174
175 }
176 .wpsl-input,
177 #wpsl-radius{
178 display:inline-block !important;
179 float: none !important;
180 }
181 #wpsl-wrap #wpsl-result-list li {
182 border-top: 1px solid #ccc;
183 border-bottom: 0px solid #ccc;
184 font-size:14px;
185 padding-left: 0px;
186 padding-right: 0px;
187 }
188 #wpsl-wrap #wpsl-result-list li a{
189 color:#009ADE;
190 text-decoration: none;
191 }
192 #wpsl-wrap #wpsl-result-list li a:hover{
193 color:#000;
194 text-decoration: underline;
195 }
196 #wpsl-wrap{
197
198 }
199
200 #wpsl-radius label{
201 float:unset !important;
202 display:inline-block !important;
203 width: 115px !important;
204
205 padding-left: 10px;
206 vertical-align: middle;
207
208 }
209 .wpsl-dropdown{
210 float:right !important;
211 display:inline-block !important;
212 border-radius: 0px !important;
213
214 width:115px;
215 border-color:#707070;
216 margin-top: -5px;
217 }
218 #wpsl-search-input {
219 font-size: 30px;
220 height: 40px !important;
221 width: 88% !important;
222 padding-bottom: 10px;
223 padding-left: 7px;
224 border: 0px solid #a4a5a8 !important;
225 border-bottom: 2px solid #54565A !important;
226 border-radius:0px !important;
227 background-color: #ffff;
228 color: #54565A;
229 }
230 @media (max-width: 767px){
231 #wpsl-search-input {
232 width: 70% !important;
233 }
234 }
235 .wpsl-input:after {
236 content: "";
237 background-image: url(./wp-content/themes/understrap-child/src/search.png);
238 height: 40px;
239 width: 40px;
240 position: relative;
241 display: inline-block;
242 background-size: contain;
243 float: left;
244 margin-top: -40px;
245 }
246 .wpsl-dropdown .wpsl-selected-item, .wpsl-dropdown li, .wpsl-selected-item {
247 list-style: none;
248 padding: 6px 4px !important;
249 margin: 0!important;
250 color:#54565A;
251 text-align: right;
252 padding-right: 35px!important;
253
254 }
255 #wpsl-wrap .wpsl-selected-item{
256
257 }
258 .wpsl-selected-item:after {
259 right: 17px;
260 border-top: 8px solid #009ADE;
261 }
262 .wpsl-active .wpsl-selected-item:after {
263 border-bottom: 8px solid #009ADE;
264 }
265 .location_name,
266 .location_distance{
267 font-family: "HelveticaNeue-Bold";
268 text-decoration: none;
269 color:#54565A;
270 }
271 #homecontent #wpsl-wrap{
272 margin:0px !important;
273 }
274 @media (max-width: 767px){
275 table.wpsl-store-location tr td {
276 font-size: 14px !important;
277 }
278 #wpsl-gmap{
279
280 width:100%;
281 height:300px !important;
282
283 }
284 #wpsl-result-list{
285 width:100%;
286
287 height: 350px !important;
288
289 }
290 .km{
291 width:50px;
292 padding-right: 10px !important;
293
294 }
295 .location{
296 display: block;
297 width: 80% !important;
298 }
299 .storelocatorlink {
300 width: 80px;
301 }
302 .location_link{
303 text-align: left !important;
304 width: 100% !important;
305 display: block;
306 padding-top: 10px !important;
307
308 }
309 .register_here{
310 font-size:14px !important;
311 }
312 #wpsl-stores {
313 margin-top: 10px;
314 }
315
316 .wpsl-store-location tr td{
317 padding: 10px 0px;
318 }
319 }
320
321
322 </style>
323
324
325 ';
326 return $output;
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 global $wpsl_settings, $wpsl;
3
4
5 $listing_template = '
6 <li data-store-id="<%= id %>"> ' . "\r\n";
7 $listing_template .= "\t\t" . '<table class="wpsl-store-location">' . "\r\n";
8 $listing_template .= '<tr><th></th><tr>
9 <tr class="results_row_top">
10
11 <td width="320" class="location">
12 <div class="address">
13 <span class="location_name" ><%= first_name %> <%= last_name %></span> </br>
14 <span>' . wpsl_store_header_template('listing') . '</span>
15 </br>
16 <span class="slp_result_address slp_result_street"><%= address %></span>
17 <span class="slp_result_address slp_result_street2"><% if ( address2 ) { %><%= address2 %><% } %></span>
18 <span class="slp_result_address slp_result_citystatezip">' . wpsl_address_format_placeholders() . '</span>
19
20 </div>' . wpsl_more_info_template() . '';
21
22 $listing_template .= "\t\t\t" . ' ';
23
24 $listing_template .= '<% if ( email ) { %><a href="#" class="start_a_contact" data-id="<%= id %>" id="<%= id %>">CONTACT</a><% } %>';
25
26 $listing_template .= '</td> </tr> </table> </li>' . "\r\n";