Skip Navigation

[Resolved] Query filter for stock status will not work

This support ticket is created 2 years, 1 month 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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by tomA-4 2 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#2479899
capture_001______20102022_061341.jpg
capture_002______20102022_061438.jpg
capture_003______20102022_061516.jpg
capture_004______20102022_061609.jpg

I am trying to: display a grid of my products, but only those in stock. Page is set up using a layout.
Child Layout cell - TEMPLATE FOR ARCHIVE id : 4463: "Product Category Archive"

row 10 - WordPress Archive: Product Search Box
If I add a filter "Woocommerce Views Filter Fields - Custom field - Product in stock status. the product grid on the front end page will display no results no matter how I set up the filter.

Link to a page where the issue can be seen: copied site to a staging environment.
hidden link

I expected to see: a grid of photos of monitor stands

Instead, I got: : No results found

#2480425
monitor-stands.jpg

Hello,

I have tried the website credentials you provided above, but get below error message:
Error: The password you entered for the username tom is incorrect.

Please check it, make sure it is a valid admin account, thanks

And I have checked the URL you mentioned above, I don't see the problem you mentioned above: No results found
See my screenshot monitor-stands.jpg

Is this problem resolved? Please let me know if you still need assistance for it.

#2482217

Hi Luo,
Sorry for the confusion. you did not see the "No results found" because I did not have the filter in place when you looked. You saw what should appear if the filter was working correctly. I have achieved this with a work around, but i still need to get the filter to work correctly.

I have put the filter back in place and now there are no results found.
i do not know how to re-submit the password to the back end of the site, there was a typo when I submitted the ticket. I will just tell you to remove the first dash (-) from what I originally gave you and it should work.
thanks,
tom

#2482289

Thanks for the details, I have done below modifications in your website:
1) Dashboard-> Toolset-> Settings-> Front-end Content, in section "Hidden custom fields", enable Woocommerce built-in stock status field: _stock_status

2) Edit the WordPress Archive:
Change the custom field filter as below:
hidden link
Select items with field:
Stock status is a string like instock

Test it in frontend:
hidden link

Please test again, check if it is fixed. thanks

#2482677

My issue is resolved now. Thank you!
Thank you Luo,
I would never have figured it out.