You can use below code to integrate Contact Form 7 into Super Store Finder for WordPress Plugin.
1. Edit js/mega-openclose.js and search for the following code:
var $infoToggler = jQuery('.info__toggler'), $infoTogglerContents = jQuery('.info__toggler-contents'); $infoToggler.togglerify({ singleActive: true, slide: true, content: function(index) { return $infoTogglerContents.eq(index); } });
Add below code after the above line of code:
jQuery('#modernBrowserConatct').on('click', '.wpcf7-form-control.wpcf7-submit', function() {
var storename =jQuery('#storeLocatorInfobox .store-location').html();
var rcvEmail =jQuery('#storeLocatorInfobox .store-email a').html();
var name_lbl = ssf_cont_us_name;
var email_lbl = ssf_cont_us_email;
var msg_lbl = ssf_cont_us_msg;
var phone_lbl = contact_plc_phone;
var name = jQuery("input[name*='your-name']" ).val();
var email = jQuery("input[name*='your-email']" ).val();
var message = jQuery("textarea[name*='your-message']" ).val();
var phone = '';
jQuery.ajax({
type: "POST",
url: ssf_wp_base + '/sendMail.php?t='+d.getTime(),
data: {name: name, email: email, phone: phone, message:message, rcvEmail: rcvEmail,subject: storename,name_lbl:name_lbl, email_lbl:email_lbl, msg_lbl:msg_lbl, phone_lbl:phone_lbl},
cache: false,
success: function (html)
{
document.getElementById("ssf-contact-form").reset();
document.getElementById("ssf-msg-status").innerHTML = ""+ssf_msg_sucess+"";
jQuery('#imageMsgAlert').fadeOut(5000);
}
});
});
2. Edit ssf-wp-functions.php search for code below:
<div class='main-popup-holder' id='mainPopupContat' style='display:none;'> <div class='ssf-popup' id='modernBrowserConatct'> <a href='javascript:hideConatctPopup();' class='popup-closer ssflinks'>$ssf_close_btn</a> <form id='ssf-contact-form' action='#' method='post' name='form' role='form'> <div><h3 class='ssf_cont_store'>$contact_us_store</h3><h4 id='ssf-msg-status'></h4></div> <div> <label> <div class='ssf_cont_lab ssf-red-star' >$contact_us_name: (</div><div class=' ssf-red-star-close'>)</div> <input placeholder='$contact_plc_name' name='ssf_cont_name' type='text' tabindex='1' required autofocus> </label> </div> <div> <label> <div class='ssf_cont_lab ssf-red-star' >$contact_us_email: (</div><div class=' ssf-red-star-close'>)</div> <input placeholder='$contact_plc_email' name='ssf_cont_email' type='email' tabindex='2' required> </label> </div> <div> <label> <div class='ssf_cont_lab'>$contact_us_phone</div> <input placeholder='$contact_plc_phone' name='ssf_cont_phone' type='tel' tabindex='3'> </label> </div> <div> <label> <div class='ssf_cont_lab ssf-red-star'>$contact_us_msg: (</div><div class=' ssf-red-star-close'>)</div> <textarea placeholder='$contact_plc_msg' name='ssf_cont_msg' tabindex='4' required></textarea> </label> </div> $ssf_accept_privacy <div> <button name='submit' type='button' id='contact-submit'>$contact_us_btn</button> </div> </form> <script> function hideConatctPopup() { jQuery('#mainPopupContat, #modernBrowserConatct').removeClass('is-shown'); } function showConatctPopup() { jQuery('#mainPopupContat, #modernBrowserConatct').addClass('is-shown'); } </script> </div> </div>
Remove code above and replace with:
<div class='main-popup-holder' id='mainPopupContat' style='display:none;'> <div class='ssf-popup' id='modernBrowserConatct'> <a href='javascript:hideConatctPopup();' class='popup-closer ssflinks'>$ssf_close_btn</a> ".do_shortcode('[contact-form-7 id="1" title="Contact Form 1"]')." <script> function hideConatctPopup() { jQuery('#mainPopupContat, #modernBrowserConatct').removeClass('is-shown'); } function showConatctPopup() { jQuery('#mainPopupContat, #modernBrowserConatct').addClass('is-shown'); } </script> </div> </div>
* The contact form 7 shortcode above can be changed to your customized contact form ID accordingly.
Important Notice: The above code are just for reference on how to integrate Super Store Finder with Contact Form 7 Plugin. Based on Codecanyon support policy here, the off-the-shelf product features come as it is as per item description and live preview page, customization is not part of the support scope, however can be requested to our devs team via this contact form here if needed.
Users who have LIKED this post: