Skip Navigation

[Resolved] order woocommerce by archive by category with category titles

This support ticket is created 8 years 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.

Our next available supporter will start replying to tickets in about 0.99 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 8 years ago.

Assisted by: Luo Yang.

Author
Posts
#381940

I am just making a new site and want help with the shop page here. hidden link

I want to be able to order the products by category, but also have category titles splitting up the page.

e.g. from the content already on there this would mean

Natural Flooring (Main Category Title)

Sisal (Sub Category Heading)

Sisal Product listings.

Coir (Sub Category Heading)

Coir Product Listings.

I have managed similar in the past using shortcodes on a view for the site hidden link, but on the new site I'm creating I want to maintain the ability to search by colour etc. - NB if a category has no results when searching, I would like the title not to show.

I tried applying a conditional statement, but couldn't find one that worked to show products in a particular category.

Many Thanks

Guy

#382330

Dear Guy,

Q1) order the products by category
The default shop page of Woocommerce plugin is archive page of post type "Products", and the query of wordpress archive page is setup by wordpress, Views can not change it, but you can try with wordpress action hook "pre_get_posts", more help:
http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts

Q2) have category titles splitting up the page
Same as above, Views can not modify the query of archive page, so I suggest you create another wordpress standard page to replace it, in this page create nested view to display the products, for example:
1) 1st view list top level terms
2) 2nd view list sub level terms
3) 3rd view list posts under sub level term
See our document:
Views Inside Views – Display Nested Multidimensional Lists
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

#382450

Thanks Luo

Almost there I think hidden link

How can I make it so that it shows listings when there are no sub-categories e.g. on the page at the moment the category for Wool needs to be showing a product (it has no sub category)

Where would I implement a parametric search that works on all the products? I tried creating one in the listings view, but that creates a search above all the sections that list items.

Also, if using a parameter such as colour, is there a way to add a coloured box, instead of the word grey, or next to it?

Many Thanks

Guy

#384568

Q1) How can I make it so that it shows listings when there are no sub-categories e.g. on the page at the moment the category for Wool needs to be showing a product (it has no sub category)

You can edit the 2nd taxonomy view of step 2) , in section "Loop Output", find the shortcodes:
[wpv-no-items-found]
...
[/wpv-no-items-found]

Put the 3rd posts view of step 3) into it, for example:
[wpv-no-items-found]
[wpv-view name="my products view name"]
[/wpv-no-items-found]

It will be able to output the 3rd view when there isn't sub term found.

Q2) Where would I implement a parametric search that works on all the products? I tried creating one in the listings view, but that creates a search above all the sections that list items.

You can implement it the in 3rd posts view, but in your case, you will need to output the views result and filter form separately,
see our document:
https://toolset.com/documentation/user-guides/front-page-filters/
section "Displaying the Parametric Search View on the Site"
screenshot:
hidden link

Q3) Also, if using a parameter such as colour, is there a way to add a coloured box, instead of the word grey, or next to it?
Unfortunately, there isn't such a feature within Views, I put it into our to-do list as a feature request, our developers will take care of it, but there isn't any ETA for it.
Currently you can check out our certified partners for it:
https://toolset.com/consultant/

And please create different thread for different questions, this will help other users to find the answers, thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.