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
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";