Leadhood
Leadhood

Reputation: 15

Show multiple product categories woocommerce

I've been trying to display multiple product categories on the shopping page.

For instance if I open the following url:

woocommerce/?product_cat=shirts

This will show me all the shirts. well thats nice, but I also only like to see all the blue shirts.

woocommerce/?product_cat=blue

What file do I need to edit to make me select multiple categories? or should I select multiple product categories an other way?

I was looking for a solution like this:

woocommerce/?product_cat=shirts|blue

the link would be changed from a form on top of the shopping page with check boxes. I think that would make a very nice way of sorting products.

Upvotes: 1

Views: 4602

Answers (4)

Mohammad Salehi
Mohammad Salehi

Reputation: 776

You can use something like this: https://example.com/product-category/cat1,cat2/

note that the page title will be the first category specified in the URL.

Tested and works in woocomerce 6.1.1 and Wordpress: 5.9

Upvotes: 0

Pila
Pila

Reputation: 5832

What worked for my case was https://findfitness.store/shop/?product_cat=accessories,electronics-gadgets,category3

Where:

  • accessories
  • electronics-gadgets
  • category3

Are the slugs of the various categories.

Upvotes: 0

Manuel Ragazzini
Manuel Ragazzini

Reputation: 909

This is the solution that you looking for:

?product_cat=shirts+blue

Upvotes: 1

Chitkaran Singh
Chitkaran Singh

Reputation: 1

Here's your solution mate

[product_categories number="" orderby="name" hide-empty="1" parent="0"]  

Upvotes: 0

Related Questions