Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jeff Balicki
/
FP_Canada
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
55b048e6
authored
2022-01-26 15:09:24 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
wpsl
1 parent
f7597746
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
7 deletions
wp-content/themes/understrap-child/inc/emails.php
wp-content/themes/understrap-child/inc/wpsl.php
wp-content/themes/understrap-child/js/custom-javascript.js
wp-content/themes/understrap-child/src/images/search.png
wp-content/themes/understrap-child/wpsl-templates/store-custom_more_info.php
wp-content/themes/understrap-child/wpsl-templates/store-listings-map-left.php
wp-content/themes/understrap-child/wpsl-templates/store-listings.php
wp-content/themes/understrap-child/inc/emails.php
View file @
55b048e
...
...
@@ -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'
;
...
...
wp-content/themes/understrap-child/inc/wpsl.php
View file @
55b048e
...
...
@@ -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
...
...
wp-content/themes/understrap-child/js/custom-javascript.js
View file @
55b048e
...
...
@@ -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
){
...
...
wp-content/themes/understrap-child/src/images/search.png
0 → 100644
View file @
55b048e
3.18 KB
wp-content/themes/understrap-child/wpsl-templates/store-custom_more_info.php
0 → 100644
View file @
55b048e
<?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>'
;
wp-content/themes/understrap-child/wpsl-templates/store-listings-map-left.php
0 → 100644
View file @
55b048e
This diff is collapsed.
Click to expand it.
wp-content/themes/understrap-child/wpsl-templates/store-listings.php
0 → 100644
View file @
55b048e
<?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
"
;
Please
register
or
sign in
to post a comment