PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Reset button doesn't work - filter is saved

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi,

The filter is remembered despite pressing the reset key.

Page: notocolor.pl
Click:"Bestsellery" title, it loads the page: https://notocolor.pl/bestsellery/
At the end of log you'll find last selected filter, e.g.:

 'taxonomy' => 'product_cat',
    'field' => 'slug',
    'terms' => 'bialy-2015-2020',

Cheers,
Tom

Additional info:

I choose the Lexus brand, I give Filter -> no products everywhere. I click on Clear -> all products appear. Until now it is OK. Now I click on the heading Bestsellers or Limited Editions and take me to the dedicated page, where all products should be displayed (because the filters have been cleared), and yet the filters still work - see the end of the log.

1 => 
  array (
    'taxonomy' => 'product_cat',
    'field' => 'slug',
    'terms' => 'lexus',
  ),

Hello

Did you customized  code?

Please  drop  me wp-admin +FTP access   I will check  it

Hello,

No, we didn't customize the code.

The problem is that the Reset button works on the shop page but the action doesn't update the previous saved data from Filter button.

I'll send you log, pass and ftp access in private message.

Hello

I disabled  this  plugin - https://c2n.me/445VC30.png - And everything works correctly

test  video - https://c2n.me/445W76R

Hi,

Thank you for your answer and efforts. The plugin you mentioned is our authorship and - among others - it has a code for saving selected filter in a session. So you’ve just turned off the code and the main page doesn’t transfer the filters on the Bestsellers site.

I want to simplified the example as much as I can. We turned off the Sketchfab plugin and we pasted the snippet code from FAQ 9. into functions.php in child-theme.

See the video below - it shows the problem:
https://youtu.be/L8maGlTT7RQ

We are absolutely sure that Reset button doesn’t clear the data stored in woof_last_search_request. And we really need a patch for this.

Hello

Please  read my  previous message    -  https://c2n.me/446QtY7.png

We are absolutely sure that Reset button doesn’t clear the data stored in woof_last_search_request. -  Yes, of course! This button should not do this and will never do it.  the meaning of this variable is to store the last search query.

If you want to change this behavior you should hire a developer.

 

Hi,

I am afraid you didn’t understand our needs properly, and gave us some random “solutions” which are even mutually exclusive sometimes. So I will try to explain it once more. 

Let's say we have a Store.

In our Store we have a Products.

Each Product has a several Categories assigned.

  1. On the Shop page we have a WOOF Filter.
  2. User filters products (by categories) in WOOF Filter (proper data are stored in Transients API which is available in WOOF as a woof_last_search_request)
  3. After filtering products User selects one Product, and go to the Product page
  4. We check the WOOF filter (woof_last_search_request) and customize the product page (it is not important for you what customizations we made here).
    Everything is working fine until this point. The only problem is with Clearing filter data.
  5. User back to a Shop page
  6. Click Clear filters button
  7. Go to a Product page
  8. We check the WOOF filter (woof_last_search_request) and we get the last search data which was already cleared by the user! While we want to get info about empty filter at this situation.

Maybe woof_last_search_request isn’t a proper parameter for our cause. But there is a lack of proper documentation and code reference to your plugin, which is the reason we ask about it in the forum.

Is there any variable like woof_current_search_request which return the current state of WOOF Filters (including cleaning)?

If not, then how can we check globally (on any page not only Shop page) what data was last filtered by the user (if he cleared the data, then we want to know that)

Of course we can just rip your plugin apart and hardcode everything we need, but it would prevent further updates, so we prefer to extend your plugin rather than that. But we need some code hints which are not presented in the official docs.

It is not some random freeware plugin. We bought it because it seems to be reliable and we expected a proper support not only on a basic level (“please Mister could you help me click the install button”) but also in a developer questions.

Hello

I understand you perfectly!

Before contacting support - please describe that you have customized the code  - it saves my time and your time!

Customization of the code is not included in the support. For this you should hire a developer.

The code presented in the documentation is an example for developers.

Let's look at the code:

woof_last_search_request - last search request is stored here. In your case, you need to clear the variable when you click reset or write an empty result to it

Go  to  the  plugin  code  and  CNTRL+F"woof_last_search_request"

https://c2n.me/4480fiu.png - to write something to this variable you need to have it( $this->get_swoof_search_slug()  ) in the search query

$this->get_swoof_search_slug() - https://c2n.me/4480FF3.png

we can assume that such a URL is enough to clear the data - https://c2n.me/4480TIj.png

In this case, after pressing the reset button, you can add to  URL this - swoof=1  - then empty data will be written to this variable"woof_last_search_request"

how to do it:

You can override this function in file - function woof_init_reset_button()

Example add a property  to  link:

var link = woof_current_page_link +"?" + swoof_search_slug +"=1";

This is one way.

I explained it in such detail that you could implement it by your own logic and correct it in case of an error. Of course, if you have experience in programming.

Unfortunately, it is impossible to have ready-made solutions for all custom tasks

 

Big thank you for your help. Now everything works fine.

Please, consider adding such a function to the plugin.

Hello

Unfortunately, we will not add this to the new version of the plugin because it is a custom solution