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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
465 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
<?php
global
$wpsl_settings
,
$wpsl
;
$output
=
$this
->
get_custom_css
();
$autoload_class
=
(
!
$wpsl_settings
[
'autoload'
]
)
?
'class="wpsl-not-loaded"'
:
''
;
$output
.=
'<div id="wpsl-wrap">'
.
"
\r\n
"
;
$output
.=
"
\t
"
.
'<div class="wpsl-search wpsl-clearfix '
.
$this
->
get_css_classes
()
.
'">'
.
"
\r\n
"
;
$output
.=
"
\t\t
"
.
'<div id="wpsl-search-wrap">'
.
"
\r\n
"
;
$output
.=
"
\t\t\t\t
"
.
'<label id="label-search-input" for="wpsl-search-input">SEARCH BY POSTAL CODE:</label>'
;
$output
.=
"
\t\t\t
"
.
'<form id="wpsl-form" autocomplete="off">'
.
"
\r\n
"
;
$output
.=
"
\t\t\t
"
.
'<div class="wpsl-input">'
.
"
\r\n
"
;
$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
"
;
$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
"
;
$output
.=
"
\t\t\t\t
"
.
'</div>'
.
"
\r\n
"
;
$output
.=
"
\t\t\t\t
"
.
'</div>'
.
"
\r\n
"
;
$output
.=
"
\t\t
"
.
'</form>'
.
"
\r\n
"
;
$output
.=
"
\t\t\t
"
.
'</div>'
.
"
\r\n
"
;
$output
.=
"
\t
"
.
'<div id="wpsl-result-list">'
.
"
\r\n
"
;
$output
.=
"
\t\t\t
"
.
'<strong>SEARCH RESULTS</strong>'
.
"
\r\n
"
;
$output
.=
"
\t\t\t
"
.
'<br/>Select the financial planner most convenient to you:<br/><br/>'
.
"
\r\n
"
;
$output
.=
"
\t\t
"
.
'<div id="wpsl-stores" '
.
$autoload_class
.
'>'
.
"
\r\n
"
;
$output
.=
"
\t\t\t
"
.
'<ul></ul>'
.
"
\r\n
"
;
$output
.=
"
\t\t
"
.
'</div>'
.
"
\r\n
"
;
$output
.=
"
\t
"
.
'</div>'
.
"
\r\n
"
;
$output
.=
"
\t
"
.
'<div id="wpsl-gmap" class="wpsl-gmap-canvas full"></div>'
.
"
\r\n
"
;
$output
.=
'</div>'
.
"
\r\n
"
;
$output
.=
'<style>
#wpsl-category{
margin-top: 30px;
float:right !important;
}
#label-search-input{
display: inline-block;
text-align: unset;
overflow: hidden;
}
#wpsl-category label{
width: 100px !important;
text-transform: none;
loat: unset !important;
display: inline-block !important;
width: 115px !important;
padding-left: 10px;
vertical-align: middle;
}
.results_row_top{
background :transparent !important;
}
.wpsl-search{
margin-bottom: 12px;
padding: 0px;
background: #fff !important;
}
.broker_radio{
disply:none !important;
}
#wpsl-gmap,
#wpsl-result-list{
width:48.5%;
height:400px !important;
display: inline-block;
float:left;
font-size:18px;
}
#wpsl-stores{
height: 330px !important;
}
#wpsl-gmap{
width:48.5%;
float:right;
position: absolute;
margin-left: 0%;
transition:0.5s;
transition-delay:3s;
margin-left: 20px;
}
#wpsl-gmap.full{
position: absolute;
width: 50%;
overflow: hidden;
margin-left: 0%;
transition:0.5s;
transition-delay:3s;
}
.location_distance{
display:none !important;
float: none !important;
}
#wpsl-wrap #wpsl-result-list li {
border-top: 1px solid #ccc;
border-bottom: 0px solid #ccc;
font-size:14px;
padding: 0px;
}
#wpsl-wrap #wpsl-result-list li a{
color:#007DB3;
text-decoration: none;
}
#wpsl-wrap #wpsl-result-list li a:hover{
color:#000;
text-decoration: underline;
}
.location_link{
float: right;
width: 0%;
}
@media (max-width: 767px){
#wpsl-gmap.full{
position: relative;
width: 50%;
height: 400px !important;
float: none;
display: block;
margin-left: 0%;
margin-top: 100px;
}
}
@media (max-width: 767px){
#wpsl-gmap,
#wpsl-result-list{
width:50%;
height:400px !important;
float:none;
display:block;
}
}
#wpsl-search-btn {
display:none !important;
}
td, th {
vertical-align: top;
}
#wpsl-search-input{
border: 0px solid #a4a5a8;
border-bottom: 2px solid #000;
background-color: #F1F7E6;
color:#54565A;
}
#wpsl-search-input::-webkit-input-placeholder { /* Edge */
color: #949598;
font-family: "HelveticaNeue";
}
#wpsl-search-input:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #949598;
font-family: "HelveticaNeue";
}
#wpsl-search-input::placeholder {
color: #949598;
font-family: "HelveticaNeue";
}
#wpsl-search-btn, #wpsl-search-wrap div{
margin-right: 10px;
}
.wpsl-input,
#wpsl-radius{
display:inline-block !important;
float: none !important;
}
#wpsl-wrap #wpsl-result-list li {
border-top: 1px solid #ccc;
border-bottom: 0px solid #ccc;
font-size:14px;
padding-left: 0px;
padding-right: 0px;
}
#wpsl-wrap #wpsl-result-list li a{
color:#009ADE;
text-decoration: none;
}
#wpsl-wrap #wpsl-result-list li a:hover{
color:#000;
text-decoration: underline;
}
#wpsl-wrap{
}
#wpsl-radius label{
float:unset !important;
display:inline-block !important;
width: 115px !important;
padding-left: 10px;
vertical-align: middle;
}
.wpsl-dropdown{
float:right !important;
display:inline-block !important;
border-radius: 0px !important;
width:115px;
border-color:#707070;
margin-top: -5px;
}
#wpsl-search-input {
font-size: 30px;
height: 40px !important;
width: 88% !important;
padding-bottom: 10px;
padding-left: 7px;
border: 0px solid #a4a5a8 !important;
border-bottom: 2px solid #54565A !important;
border-radius:0px !important;
background-color: #ffff;
color: #54565A;
}
@media (max-width: 767px){
#wpsl-search-input {
width: 70% !important;
}
}
.wpsl-input:after {
content: "";
background-image: url(./wp-content/themes/understrap-child/src/search.png);
height: 40px;
width: 40px;
position: relative;
display: inline-block;
background-size: contain;
float: left;
margin-top: -40px;
}
.wpsl-dropdown .wpsl-selected-item, .wpsl-dropdown li, .wpsl-selected-item {
list-style: none;
padding: 6px 4px !important;
margin: 0!important;
color:#54565A;
text-align: right;
padding-right: 35px!important;
}
#wpsl-wrap .wpsl-selected-item{
}
.wpsl-selected-item:after {
right: 17px;
border-top: 8px solid #009ADE;
}
.wpsl-active .wpsl-selected-item:after {
border-bottom: 8px solid #009ADE;
}
.location_name,
.location_distance{
font-family: "HelveticaNeue-Bold";
text-decoration: none;
color:#54565A;
}
#homecontent #wpsl-wrap{
margin:0px !important;
}
@media (max-width: 767px){
table.wpsl-store-location tr td {
font-size: 14px !important;
}
#wpsl-gmap{
width:100%;
height:300px !important;
}
#wpsl-result-list{
width:100%;
height: 350px !important;
}
.km{
width:50px;
padding-right: 10px !important;
}
.location{
display: block;
width: 80% !important;
}
.storelocatorlink {
width: 80px;
}
.location_link{
text-align: left !important;
width: 100% !important;
display: block;
padding-top: 10px !important;
}
.register_here{
font-size:14px !important;
}
#wpsl-stores {
margin-top: 10px;
}
.wpsl-store-location tr td{
padding: 10px 0px;
}
}
</style>
'
;
return
$output
;
\ No newline at end of file
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