Skip Navigation

[Resolved] Show SubCategories and Products in Views

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 3 voices.

Last updated by Minesh 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1193501

What I'm trying to do, is to recreate with Views the WooCommerce option to show products and categories together. WC calls it: Category display, Choose what to display on product category pages. = Show SubCategories and Products

So this is my sample situation.

Jewelry
-Ring
-Bracelet
-GoldCat
---GoldRing1
---GoldRing2
---WhiteGoldCat
-----WhiteGoldRing1
-----WhiteGoldRing2
---RoseGoldCat
-----RoseGoldRing1
-----RoseGoldRing2
-SilverCat
---SilverRing1
---SilverRing2

What I want is

If in Jewelry, it shows
Ring (prod)
Bracelet (prod)
GoldCat (cat)
SilverCat (cat)

If in GoldCat, it shows
GoldRing1 (prod)
GoldRing2 (prod)
WhiteGoldCat (cat)
RoseGoldCat (cat)

If in SilverCat, it shows
SilverRing1
SilverRing2

When I create a view with Views, I can only select a taxonomy term or post type. Is there a way to recreate this WC behavior? Which is a quite standard one in my opinion. In a store with a lot of categories and subcategories would be nice to have them together.

thanks

#1193538

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you indeed need to use view inside view but you need a page where you can list all taxonomy terms and then. So the idea would be:
- Category
--- Sub-Category
----- Product

How you want is I need to check how you configure your view based on that I will be able to guide you in the right direction.

Could you please share problem URL and access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1193549

Hi,thanks for the answer. I can't share any data since it's a local site and there's almost nothing in it, just test data.

Currently, I have a layout for archives which shows 1- taxonomy view and 2- post view.
With this, I can't filter products and show only product directly under the current category. And also, the two views are not connected so posts are not sorted together.

I also tried with a view inside a view, but since I am new to the concept of nested views, I wasn't really sure how to setup them to achieve what I want.

Basically, all I need is the WC behavior. And show terms and posts (links) together, filterable etc.

#1194113

Hello,

Here is a document about "Views Inside Views – Display Nested Multidimensional Lists"
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

For the question: I can't filter products and show only product directly under the current category
Please check above document , section "Taxonomy View with a Post View for a Child", screenshot:
hidden link

For the problem:
the two views are not connected so posts are not sorted together

You just need to put the child post view insider loop of parent taxonomy view, see above document, section "Adding a View to a View".

#1194170
2019-02-01_18-14-16.jpg

Ok, I was playing with that view inside view article, but, if I get it right, still doesn't solve my problem.

Putting a view inside another view loop results in two loops anyway, simply one inside the other. But the resulting elements are not mixed together, is still one and then the other!

I attached a screenshot of what I am trying to achieve, hope that helps.

#1194181

It is not clear, I assume we are talking about this case:

In your screenshot:
hidden link
The first row displays 1 term + two posts + 1 term
The second row displays 1 term + 1 post + 1 term + 1 post
...
Is there any "regular pattern" in them?

The Views within Views feature can display the results in hierarchical structure, for example:
- Term 1
---- Post A
---- Post B
- Term 2
---- Post C
---- Post D
...

How do you want to mix resulting elements together?

Please elaborate the question with more details.

#1194329

yes, that was actually a random example, but my point was "ordered alphabetically" or something like that.
The Term1 etc. example you wrote is exactly the opposite of my initial question.

basically, I don't want to see terms' children in the current view!

Term1 (just the title)
Post1
Post2
Term2 (just the title)
Post3
Post4

All in the same level, so post1,2,3and4 are NOT children of Term1 and 2, they are in the main page.

My initial example:

Jewelry
-Ring
-Bracelet
-GoldCat
---GoldRing1
---GoldRing2
---WhiteGoldCat
-----WhiteGoldRing1
-----WhiteGoldRing2
---RoseGoldCat
-----RoseGoldRing1
-----RoseGoldRing2
-SilverCat
---SilverRing1
---SilverRing2

What I want is

If in Jewelry, it shows
Ring (prod)
Bracelet (prod)
GoldCat (cat)
SilverCat (cat)

If in GoldCat, it shows
GoldRing1 (prod)
GoldRing2 (prod)
WhiteGoldCat (cat)
RoseGoldCat (cat)

If in SilverCat, it shows
SilverRing1
SilverRing2

And, like I said, this is a regular WooCommerce behavior so it should be possible

#1195410

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - can you share problem URL where you want to display it, its not straight forward but I will try to check if that possible with the content you shared.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.