| Linux server27.hostingraja.org 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64 Path : /home/udaipurk/public_html/websites/rishh/XStore Theme/xstore/js/theme/fixes/ |
| Current File : //home/udaipurk/public_html/websites/rishh/XStore Theme/xstore/js/theme/fixes/theme-wcpf.js |
/**
* Fix navigation for wcpf plugin
*
* @version 1.0.0
* @since 1.0.0
*/
;(function ($) {
"use strict";
etTheme.autoinit.wcpfPaginationFix = function () {
$(window).on('wcpf_update_products', function() {
$('nav.etheme-elementor-pagination').find('a').each(function () {
let href = $(this).attr('href'), // Get the current href from pagination links
url = new URL(href, window.location.origin), // Ensure the href is converted to a full URL
params = new URLSearchParams(url.search), // Get parameters from the pagination link
current_params = new URLSearchParams(window.location.search); // Get current page parameters
// Merge current_params into params (overwriting existing values if necessary)
current_params.forEach((value, key) => {
params.set(key, value); // Add or update parameters
});
// Update the href with the merged parameters
url.search = params.toString();
$(this).prop('href', url.toString()); // Set the new href with merged params
});
});
};// End of wcpfPaginationFix
})(jQuery);