Skip Navigation

[Resolved] Woocommerce filters

This support ticket is created 6 years, 2 months 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
- 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/Karachi (GMT+05:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 6 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1124700

Hi, i've created a view which works on hidden link but when i've moved it over to a newer version of the site which we are building using elemontor and types, the filters on the right no longer work and I can't seem to figure out why so was hoping you could help

you can see the page at: hidden link by logging in using, username: Elementor and password: Vp4LE%YqpkxbQEMW8g%zHxfk

cheers

#1125128

Hi Andy,

Thank you for contacting us and I'll be happy to assist.

Looking into your view ("Hops View"), I noticed that it is set to show "Products", but no search filters are set in it.

This is the reason why the results are not being filtered when parameters from the sidebar ( e.g. filter_country=uk ) are passed to it.

To make this work, you'll first enable the "Search and Pagination" section on the views edit screen, from the top right drawer "Screen Options".

Once enabled, you can add a filter for each of the options available in the sidebar, making sure that the URL parameter matches.

We have a useful guide on the topic at:
https://toolset.com/documentation/user-guides/front-page-filters/

I hope this helps! Please let us know if you need any further assistance.

regards,
Waqar

#1125232

Great thanks that makes sense as it's using the view differently to how it was on the old site due to elementor, how do i add a text search? ive clicked the text search button but there doesn't appear to be an option to edit the parameter so that it matches the s= in the widget?

#1126169

Hi Andy,

Thanks for writing back.

By default, the Views plugin uses "wpv_post_search" parameter for the text search field.

You can remove the "Products Seach" widget from the sidebar and instead add the following custom HTML code for the search form in a regular "Custom HTML" widget:


<form role="search" method="get" class="woocommerce-product-search" action="">
	<label class="screen-reader-text" for="woocommerce-product-search-field">Search for:</label>
	<input type="search" id="woocommerce-product-search-field" class="search-field" placeholder="Search products…" value="" name="wpv_post_search">
	<button type="submit" value="Search">Search</button>
	<input type="hidden" name="post_type" value="product">
</form>

This new search form will not only connect with the view's text search filter but will also show the results on the same page.
(unlike the "Products Seach" widget, which shows the results on the homepage).

Please let me know how it goes and if you have any further information or questions.

regards,
Waqar