Home Forums WoodMart support forum Products per page of grid + ajax pagination problem

Products per page of grid + ajax pagination problem

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #204740

    smaybe
    Participant

    Hello,
    first issue: when i set the number of product per page of grid it’s not the right number of products that showing up, worse it changes randomly from page to page,
    i disabled all the plugin that may affect the theme, it’s working with twenty twenty, you can switch it

    second issue: when you paginate, it will do the ajax call, update the content (with the same one) and then load the next page (not in ajax)

    can you guys give a look please ?
    thanks
    Christophe

    #204789

    Hello,

    As for the number of products on the page, this problem is not caused by our theme, as you can see the same is on the default theme: http://prntscr.com/t2p36j http://prntscr.com/t2p3l8

    In order to fix AJAX problem, add this code to the functions.php of the child theme:

    add_filter( 'woodmart_pjax_timeout', function(){
    	return 30000;
    } );

    Best Regards

    #204812

    smaybe
    Participant

    oh ok so i will investigate what’s going on with the grid then

    thank you very much for the ajax fix, it’s working perfectly

    perfect support

    regards
    Christophe

    #204825

    smaybe
    Participant

    just a message to let you know that apparently woocommerce could count out of stock products in the pagination

    solution for me (for the moment)

    add_action('woocommerce_product_query', 'show_only_instock_products');
    
    function show_only_instock_products($query) {
    $meta_query = $query->get( 'meta_query' );
    $meta_query[] = array(
    'key' => '_stock_status',
    'compare' => '=',
    'value' => 'instock'
    );
    $query->set( 'meta_query', $meta_query );
    }

    not sure if it’s the best
    but hope this helps
    Christophe

    #204858

    You are welcome! If you have any questions please feel free to contact us.

    Best Regards

Viewing 5 posts - 1 through 5 (of 5 total)