Forums › Forums › Search & Filter Pro › Return URL after reset to last category instead of SHOP?
Tagged: woocommerce
- This topic has 5 replies, 2 voices, and was last updated 6 years, 4 months ago by Anonymous.
-
Trevor(Private) July 18, 2018 at 4:39 pm #182900
There is not a simple way to do as you ask, however …
You would need some custom javascript (I can’t help you with this) that runs on document load. It looks to see if an input with the class
search-filter-reset
exists on the page, and if it does, it deletes that, finds the URL of the page and strips off the search query string, and inserts a link to that URL into the<li>
with the class of sf-field-reset.In effect, the Reset button no longer runs our javascript, but instead reloads the page without any query, which resets the query but keeps the form on the page.
Alternatively, if you want to code this in PHP, don’t have the Reset button in the form, but instead have a button immediately after the form with the current page URL in it.
-
AuthorPosts