Forums › Forums › Search & Filter Pro › Integration with popup maker
- This topic has 18 replies, 2 voices, and was last updated 5 years, 1 month ago by Trevor.
-
Anonymous(Private) October 4, 2019 at 10:35 am #222857
Great Trevor, it works, thanks! I will just have to do some styling.
However the initial question remains:
When I select a filter choice on mobile width and click on “Rechercher” the popup closes correctly and I see the results of my search. But if I try to access the popup again on this very same page to change the filter choices and click on “Rechercher” a second time, nothing happens.
I am aware this is probably due to Popup maker as if it failed to take into account a seconde S&F “submit” action.
Thanks for your help.
Trevor(Private) October 4, 2019 at 6:20 pm #222934Does the page use Ajax to load the results? If o, you need to re-initialize any JavaScript on that form, like this:
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax complete"); // call your function here }); }(jQuery));</script>
Anonymous(Private) October 7, 2019 at 8:59 am #222981Thanks Trevor,
Adding this code to my functions.php file apparently does the job well:
add_action( 'wp_footer', 'my_custom_popup_scripts', 500 ); function my_custom_popup_scripts() { ?> <script type="text/javascript"> (function ( $, document, undefined ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax complete"); PUM.close(32205); // Change 123 to match your popups ID # from the All Popups screen. }); }(jQuery, document)); </script><?php }
-
AuthorPosts