This topic has 7 replies, 3 voices, and was last updated 6 months, 3 weeks ago ago by Andrew Mitchell
Currently, only a limited number of pages are displayed in the navigation.
I would like to know if there is a way to adjust the settings to show a higher number of pages in the product pagination. This would allow users to easily navigate through a large product catalog.
Thank you for your time and assistance.
Hi @PanosN,
There is no settings to change the number of pages in the pagination. Please take a look at this file: /wp-content/plugins/et-core-plugin/app/controllers/elementor/general/product-grid.php line 3242
– Change:
'end_size' => 2,
'mid_size' => 2,
– To:
'end_size' => 12,
'mid_size' => 12,
Hope it helps!
I changed the file according to your advice and flushed all caches.
It doesn’t seem to achieve the desired effect, and I’m not sure if there is any optical or functional change to the pagination.
Hi @PanosN,
Can you please try adding the following code under functions.php file locates in your child theme?
function et_woocommerce_pagination() {
$args = array(
'total' => wc_get_loop_prop( 'total_pages' ),
'current' => wc_get_loop_prop( 'current_page' ),
'base' => esc_url_raw( add_query_arg( 'product-page', '%#%', false ) ),
'format' => '?product-page=%#%',
);
// @todo make push ajax loaded styles/scripts in footer and prevent load next times
etheme_enqueue_style( 'pagination', isset($_GET['et_ajax']));
$format = isset( $format ) ? $format : '';
$base = esc_url_raw( add_query_arg( 'product-page', '%#%', false ) );
if ( ! wc_get_loop_prop( 'is_shortcode' ) || wc_get_loop_prop('etheme_elementor_product_widget') ) {
$format = '';
$base = esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', wp_specialchars_decode( get_pagenum_link( 999999999 ) ) ) ) );
}
$total = isset( $total ) ? $total : wc_get_loop_prop( 'total_pages' );
$current = isset( $current ) ? $current : wc_get_loop_prop( 'current_page' );
// $et_per_page = ( isset( $_REQUEST['et_per_page'] ) ) ? $_REQUEST['et_per_page'] : etheme_get_option( 'products_per_page', 12 );
$selected_val = ( isset( $_GET['et_per_page'] ) ) ? $_GET['et_per_page'] : false;
$is_rtl = is_rtl();
return array(
'base' => $base,
'format' => $format,
'add_args' => ( ( ! wc_get_loop_prop( 'is_shortcode' ) && $selected_val ) ? array( 'et_per_page' => $selected_val ) : false ),
'current' => max( 1, $current ),
'total' => $total,
'prev_text' => '<i class="et-icon et-'.($is_rtl ? 'right' : 'left').'-arrow"><span class="screen-reader-text hidden">'.esc_html__('prev', 'xstore').'</span></i>',
'next_text' => '<i class="et-icon et-'.($is_rtl ? 'left' : 'right').'-arrow"><span class="screen-reader-text hidden">'.esc_html__('next', 'xstore').'</span></i>',
'type' => 'list',
'end_size' => 12,
'mid_size' => 12,
);
}
Let us know how it goes!
This works perfectly!
Thank you very much for your kind help!
Glad we’re able to help you!
Dear PanosN,
In the spirit of gratitude, we want to express our appreciation for your trust in our products. As a valued customer, your experience matters greatly. Would you consider sharing it by giving our theme a deserving 5-star rating on ThemeForest?
Click here to share your thoughts: https://themeforest.net/downloads
Being part of our community means a lot, and your feedback contributes immensely.
Best Regards,
The 8Theme Team
The issue related to '‘Changing Number of Pages in Product Pagination’' has been successfully resolved, and the topic is now closed for further responses