Support » Plugin: WooCommerce » “Shop by Category” is showing by alphabetical order

  • Resolved masurana

    (@masurana)


    Sir,
    “Shop by Category” is showing by alphabetical order. However I want it showing by serial number. Please guide me. Thanks.

    • This topic was modified 1 month, 1 week ago by  masurana.
    • This topic was modified 1 month, 1 week ago by  masurana.
    • This topic was modified 1 month, 1 week ago by  masurana.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • There’s a filter which can be used to change the default order:

    add_filter( 'storefront_product_categories_args', function( $args ){
      $args['orderby'] = 'rand';
      return $args;
    } );

    The values which are available for ‘orderby’ are on this page:
    https://docs.woocommerce.com/document/woocommerce-shortcodes/

    The available options are:
    date – The date the product was published.
    id – The post ID of the product.
    menu_order – The Menu Order, if set (lower numbers display first).
    popularity – The number of purchases.
    rand – Randomly order the products on page load (may not work with sites that use caching, as it could save a specific order).
    rating – The average product rating.
    title – The product title. This is the default orderby mode.”

    I don’t know what you mean by serial number. If you are referring to the SKU, that doesn’t seem to be an available option.

    “menu_order” would seem to give you the best control. This value can be set on the Product edit page > Product Data metabox > Advanced tab.

    Sorry not tested.

    Plugin Support RK

    (@riaanknoetze)

    This thread has more to do with Storefront than the core WooCommerce plugin itself. For more support on changing the category order on the homepage while using Storefront, please use https://wordpress.org/support/theme/storefront/

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.