• Hello All,

    This plugin is working great on my website, however I want to be able to control the product per page even more than I can see.

    I have a “view all” button below the pagination and the code in my files is as follows:
    add_filter( ‘loop_shop_per_page’, ‘new_loop_shop_per_page’, 20 );

    function new_loop_shop_per_page( $cols ) {
    // $cols contains the current number of products per page based on the value stored on Options –> Reading
    // Return the number of products you wanna show per page.
    if (isset($_REQUEST[‘showall’])) {
    $cols = -1;
    }
    else { $cols = 36; }
    return $cols;
    }

    I am using the plugin inside a product tab (the 2nd tab) on the product page. The problem is when I click view all it refreshes the page, and adds ‘?showall=1’ to the url, but still only shows 36 products.

    The view all does work on the actual shop page.

    Any help would be greatly appreciated.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author RazyRx

    (@razyrx)

    Hello,

    Clear option “Products per page” in plugin settings -> Advanced tab, then plugin do not change products per page value.

    Regards,
    Oleg

    Thread Starter cadmen99

    (@cadmen99)

    Hello Oleg,

    I already have left the “Product per page” in the plugin setting blank and the issue is still there.

    Thank you

    Plugin Author Dmytro Holovnia

    (@dholovnia)

    Try 10000 instead of 20 to run your function answer our eg
    add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 10000 );

    Thread Starter cadmen99

    (@cadmen99)

    I tried that but it still does not work

    Plugin Author Dmytro Holovnia

    (@dholovnia)

    ok, if this is not working I have a question to you – why do you think the issue is in our plugin? How did you find it?

    Regards,
    Dima

    Thread Starter cadmen99

    (@cadmen99)

    I think the issue is in this plugin because my “view all” button does work on the regular woocommerce shop page.

    Plugin Author RazyRx

    (@razyrx)

    Hello,

    Please try to disable our plugin and check is it work.

    Regards,
    Oleg

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom product per page’ is closed to new replies.