Hi,
Thank you for waiting.
During testing on my website, I was able to make this "items per page" selector work, using the following steps:
1. In the view's "Search and Pagination" section, I used the updated HTML for the items per page selection links:
<span><strong>Arată:</strong> <a href="#" data-attribute="5" class="item-per-page-link">5</a> | <a href="#" data-attribute="10" class="item-per-page-link">10</a> | <a href="#" data-attribute="50" class="item-per-page-link">50</a> rezultate.</span>
2. In the "JS editor" below this section, I included this script, which updates the page, to include the selected items per post value in the URL parameter:
jQuery( document ).on( 'js_event_wpv_pagination_completed js_event_wpv_parametric_search_form_updated js_event_wpv_parametric_search_results_updated ready', function( event, data ) {
jQuery("a.item-per-page-link").click(function(event){
event.preventDefault();
var pageURL = jQuery(location).attr("href");
var linkVal = jQuery(this).attr("data-attribute");
var url = new URL(pageURL);
url.searchParams.set("item-per-page", linkVal);
var newUrl = url.href;
window.location = newUrl;
});
});
3. The updated code for the "wpv_filter_query" hooked function, would look like this:
add_filter( 'wpv_filter_query', 'filter_items_per_page_custom_fn', 1000 , 3 );
function filter_items_per_page_custom_fn( $query_args, $view_settings ) {
if ( ( !is_admin() && isset($view_settings['view_id'] ) ) && ( $view_settings['view_id'] == 1234 ) )
{
if(!empty($_GET['item-per-page'])) {
$query_args['posts_per_page'] = $_GET['item-per-page'];
}
}
return $query_args;
}
Please replace "1234" with the actual ID of the view.
Important Note: for this "items per page" selection to work effectively, it is important that the "Full page refresh when visitors click on the search button" option is selected in the "Custom Search Settings" section.
As for the issue with the "Use my location" button's icon, I was able to reprduce this on my website too and it has been reported to the concerned team already.
I'll keep you updated on this through this ticket and for now, you can use some custom script to override the text used for the button, for example:
jQuery( document ).on( 'js_event_wpv_pagination_completed js_event_wpv_parametric_search_form_updated js_event_wpv_parametric_search_results_updated ready', function( event, data ) {
jQuery('.js-toolset-maps-distance-current-location').val("Use my location");
});
regards,
Waqar