Add WooCommerce Product Category Dropdown to Shop & Archive Pages

WooCommerce has a Product Category dropdown list of available product categories which filter and refresh the page based on product selection. It is assigned via a Widget and easy enough to put in the sidebar.

But what about adding it to the top of the main shop and archive pages.?

 

woocommerce-product-category-dropdown

Here is  a way to display it in the main shop area just below the headline, in essence you create a new widget and position it below the WooCommerce page title.

So in the above code which goes into functions.php a new widget is created named ‘Product Cat Sort’ and positioned outside before the WooCommerce loop and after the headline – it will appear whenever there is a WooCommerce product loop so all the archive pages are covered. All you need to do is add the dropdown to it in the widget area.

If your product pages have a sidebar then you can also use a sidebar widget in your theme to position the dropdown there – that way you have both archive and single pages covered.

Leave a Comment





%d bloggers like this: