[resolved] [Plugin: Woocommerce] Make a "Products per page" dropdown (4 posts)

  1. DesignLoud
    Posted 3 years ago #

    Hi all, I am trying to setup a dropdown to sort the number of products per page and I cant seem to get the kinks worked out.

    Here is what I have so far, but it doesn't work and didnt know if someone knew of a workable solution?

    function woocommerce_sortby_page() {
    	if ('woocommerce_catalog_page_ordering'==$twelve)
      add_filter('loop_shop_per_page', create_function('$cols', 'return 12;'));
    elseif ('woocommerce_catalog_page_ordering'==$sixteen)
      add_filter('loop_shop_per_page', create_function('$cols', 'return 16;'));
      add_filter('loop_shop_per_page', create_function('$cols', 'return 4;'));;
    function woocommerce_catalog_page_ordering() {
    <form action="<?php 'woocommerce_sortby_page' ?>">
    <select name="woocommerce-sort-by-columns">
    <option value="<?php $twelve ?>">12</option>
    <option value="<?php $sixteen ?>">16</option>
    add_action( 'woocommerce_pagination', 'woocommerce_catalog_page_ordering', 20 );

    Thanks in advance!

  2. damian.smith
    Posted 2 years ago #

    Did you get anywhere with this?

    I am also looking into how this can be done.

  3. DesignLoud
    Posted 2 years ago #

    Hey damian, I did get it working flawlessly and have recently put a tut up on my site, super easy to customize.. I will have to try to put it in a plugin soon or just build it in to the woocommerce radio buttons plugin that we will be updating soon..

    Here is the link: http://designloud.com/how-to-add-products-per-page-dropdown-to-woocommerce/

    Good luck!

  4. damian.smith
    Posted 2 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic