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);
add_action('publish_wpsl_stores','send_notification_for_publish_project',10,1);
function send_notification_for_publish_project( $post_id ) {
$email = get_post_meta($post_id, 'wpsl_email', true);
$subject = 'WYN Registration Aproved';
$message = file_get_contents('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/inc/Registration-Acceptance.html');
$headers_customer = array('Content-Type: text/html; charset=UTF-8');
wp_mail( $email , $subject, $message, $headers_customer);
function send_notification_for_publish_project( $post_id ) {
update_post_meta($post_id, 'wpsl_country', 'CA');
delete_autoload_map_transient();
$email = get_post_meta($post_id, 'wpsl_email', true);
$subject = 'WYN Registration Aproved';
$message = file_get_contents('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/inc/Registration-Acceptance.html');
$headers_customer = array('Content-Type: text/html; charset=UTF-8');
wp_mail( $email , $subject, $message, $headers_customer);
}
}
add_action( 'trash_wpsl_stores', 'send_notification_for_delete_project' ,10,1);
function send_notification_for_delete_project( $post_id ) {
$email = get_post_meta($post_id, 'wpsl_email', true);
$subject = 'WYN Registration Denied';
......
......@@ -87,3 +87,73 @@ function custom_meta_box_fields2( $meta_fields ) {
return $meta_fields;
}
add_filter('wpsl_templates', 'custom_templates');
function custom_templates($templates)
{
$templates[] = array(
'id' => 'store',
'name' => 'Custom store template',
'path' => get_stylesheet_directory() . '/' . 'wpsl-templates/store-listings-map-left.php',
);
return $templates;
}
add_filter('wpsl_listing_template', 'custom_listing_template');
function custom_listing_template()
{
global $wpsl, $wpsl_settings;
include( get_stylesheet_directory() . '/' . 'wpsl-templates/store-listings.php');
return $listing_template;
}
add_filter('wpsl_store_header_template', 'custom_store_header_template');
function custom_store_header_template()
{
$header_template = '<% if ( wpslSettings.storeUrl == 1 && url ) { %>' . "\r\n";
$header_template .= '<a href="<%= url %>" target="_blank" class="placelink"><%= store %></a>' . "\r\n";
$header_template .= '<% } else { %>' . "\r\n";
$header_template .= '<%= store %>' . "\r\n";
$header_template .= '<% } %>';
return $header_template;
}
add_filter( 'wpsl_info_window_template', 'custom_info_window_template' );
function custom_info_window_template() {
include( get_stylesheet_directory() . '/' . 'wpsl-templates/store-custom_more_info.php');
return $info_window_template;
}
function delete_autoload_map_transient()
{
global $wpdb;
$option_names = $wpdb->get_results("SELECT option_name AS transient_name FROM " . $wpdb->options . " WHERE option_name LIKE ('\_transient\_wpsl\_autoload\_%')");
if ($option_names) {
foreach ($option_names as $option_name) {
$transient_name = str_replace("_transient_", "", $option_name->transient_name);
delete_transient($transient_name);
}
}
}
\ No newline at end of file
......
......@@ -37,6 +37,13 @@ jQuery( document ).ready(function($) {
}, 500);
});
$(document).on("submit","#wpsl-form",function() {
console.log('ssssss');
$('#wpsl-result-list').show();
$('#wpsl-gmap').show();
});
$( "#register-here" ).on( "keydown", function(event) {
if(event.which == 13){
......
<?php
global $wpsl_settings, $wpsl;
$info_window_template = '<div data-store-id="<%= id %>" class="wpsl-info-window">' . "\r\n";
$info_window_template .= "\t\t" . '<p>' . "\r\n";
$info_window_template .= "\t\t\t" . wpsl_store_header_template() . "\r\n";
$info_window_template .= "\t\t\t" . '<span><%= address %></span>' . "\r\n";
$info_window_template .= "\t\t\t" . '<% if ( address2 ) { %>' . "\r\n";
$info_window_template .= "\t\t\t" . '<span><%= address2 %></span>' . "\r\n";
$info_window_template .= "\t\t\t" . '<% } %>' . "\r\n";
$info_window_template .= "\t\t\t" . '<span>' . wpsl_address_format_placeholders() . '</span>' . "\r\n";
$info_window_template .= "\t\t" . '</p>' . "\r\n";
$info_window_template .= "\t\t" . '<% if ( phone ) { %>' . "\r\n";
$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";
$info_window_template .= "\t\t" . '<% } %>' . "\r\n";
$info_window_template .= "\t\t" . '<% if ( email ) { %>' . "\r\n";
$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";
$info_window_template .= "\t\t" . '<% } %>' . "\r\n";
$info_window_template .= '<br><br>';
<?php
global $wpsl_settings, $wpsl;
$listing_template = '
<li data-store-id="<%= id %>"> ' . "\r\n";
$listing_template .= "\t\t" . '<table class="wpsl-store-location">' . "\r\n";
$listing_template .= '<tr><th></th><tr>
<tr class="results_row_top">
<td width="320" class="location">
<div class="address">
<span class="location_name" ><%= first_name %> <%= last_name %></span> </br>
<span>' . wpsl_store_header_template('listing') . '</span>
</br>
<span class="slp_result_address slp_result_street"><%= address %></span>
<span class="slp_result_address slp_result_street2"><% if ( address2 ) { %><%= address2 %><% } %></span>
<span class="slp_result_address slp_result_citystatezip">' . wpsl_address_format_placeholders() . '</span>
</div>' . wpsl_more_info_template() . '';
$listing_template .= "\t\t\t" . ' ';
$listing_template .= '<% if ( email ) { %><a href="#" class="start_a_contact" data-id="<%= id %>" id="<%= id %>">CONTACT</a><% } %>';
$listing_template .= '</td> </tr> </table> </li>' . "\r\n";