[Résolu] Views Filter by _stock doest not work properly
This support ticket is created Il y a 3 années et 6 mois. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have a site with Toolset +WC and have created 2 Views
1. To list all products with _stock <= 0
2. To list all products with _stock >0
The issue I'm facing here is that if I change manually the stock inside a product and move it from 0 to 3 for example, then the Views are not taking this into consideration.
Some additional info :
- In the filter, I'm using field _stock, is a string (but I have also tried with numerical) + the condition
- I have checked in the database that the _stock field was really changing
- This seems to happend under certain conditions (from time to time, moving a stock to 0 is working!
Hello. Thank you for contacting the Toolset support.
Can you please share problem URL where you added the view and access details. Please also share a product sample link where you added the stock.
*** 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 have set the next reply to private which means only you and I have access to it.
Sorry but I'm not able to share url info on this.
First, could you confirm that I need to use the "string" (and not the numerical) in the filter for a custom field?
What I have seen on this is that from time to time, the issue is appearing. So, not sure this is dependent on the Views or on the product configuraiton. I have tried to see if any differences between products that are not moving when stock is 0, but nothing has come to my attention !
Let me know if I can give you additional info.
Regards
Pat
I have place the filter field as numerical and this is not changing the issue.
Just a point that I can relate : when the filter result is not good in the frontend, if I resave the Views in the backend, then the result became good.
Don't know if there is something special in the save process?
Here is my Views loop :
Can you please share problem URL as well as access details and also share information about what is your expected result.
*** 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 have set the next reply to private which means only you and I have access to it.
Thanks for your feedback.
Unfortunately, I'm not able to give you access. Is there something I can do in order to better understant the issue?
By result is not good, I mean that some products are listed in the Views but have stock = 0. So they should not be listed with this Views !!! As soon as I record the Views again, the result is different and those products with stock =0 do not appear no more?
Thanks for your answer.
That sounds difficult as this is a very huge site and Duplicator will not manage all files.
In the meantime, I am looking for a workaround by using a hook (wpv_filter_query) in order to see if I'm getting the same issue.
I will keep you informed of the result as soon as this will be done.
In parallel, if I can give you specific info that could helps you to move forward, let me know.