Merged in feature/plugins-update (pull request #9)

wp plugin updates from pantheon

* wp plugin updates from pantheon
This commit is contained in:
Tony Volpe
2023-12-15 18:08:21 +00:00
parent 28c21bf9b1
commit 779393381f
577 changed files with 154305 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
(function($) {
$().on('facetwp-refresh', function() {
if (! FWP.loaded) {
setup_woocommerce();
}
});
function setup_woocommerce() {
// Intercept WooCommerce pagination
$().on('click', '.woocommerce-pagination a', function(e) {
e.preventDefault();
var matches = $(this).attr('href').match(/\/page\/(\d+)/);
if (null !== matches) {
FWP.paged = parseInt(matches[1]);
FWP.soft_refresh = true;
FWP.refresh();
}
});
// Disable sort handler
$('.woocommerce-ordering').attr('onsubmit', 'event.preventDefault()');
// Intercept WooCommerce sorting
$().on('change', '.woocommerce-ordering .orderby', function(e) {
var qs = new URLSearchParams(window.location.search);
qs.set('orderby', $(this).val());
history.pushState(null, null, window.location.pathname + '?' + qs.toString());
FWP.soft_refresh = true;
FWP.refresh();
});
}
})(fUtil);