Home › Toolset Professional Support › [Resolved] Woocommerce View: no results
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: Africa/Casablanca (GMT+01:00)
Tagged: Custom search, Toolset Blocks, Views plugin
Related documentation:
This topic contains 15 replies, has 3 voices.
Last updated by Joe H. 3 years, 3 months ago.
Assisted by: Jamal.
I've demonstrated my issues in these loom videos:
Part 1: hidden link
Part 2: hidden link
Tell us what you are trying to do?
** I am trying to update/reuse a Toolset/Woocommerce site I used successfully a year ago for a Christmas fundraiser but now things are not working at all
Is there any documentation that you are following?
** your woocommerce guide
Is there a similar example that we can see?
** no
What is the link to your site?
** toys.blueoakschurch.org
Link for admin access to backend:
hidden link
Hi, let me respond to some comments in the videos.
First video
2:00 - Yes, this View editor is the legacy editor. The other alternative for creating a View is to create a new View using a View block in the Block editor.
2:20 - "That means I can't use the block editor".
Some clarification for you. Let's say you originally build some new View completely in the Block Editor. What is not currently possible is dragging a new View block into the loop of that View and creating your nested View directly there in the Block Editor. That is the limitation you should be aware of. However, you're pointing at the "Block Editor" button above the loop template editor panel. This gives you the ability to design the loop template, the portion that repeats, in the Block Editor. That is still possible in any case, the limitation does not apply to this button. The limitation is only about creating a nested View in situ, or in place, in the Block Editor.
I jumped into the Page editor and began modifying the View in the View block. First, I wanted to get at least one result to appear, so I temporarily deleted the Stock Status Query Filter. I suspected that was the main reason the View displayed "no results found", and removing it confirmed my suspicion. Let's come back to that a bit later.
Then I adjusted the filter for # of children. I noticed that there was no default placeholder defined in the configurations for this filter, so I added one. See the placeholder.png screenshot showing the current settings for this filter. The Dropdown Placeholder field was empty before, so I added "Any # of Children". Without the default placeholder defined, the first option 1 is displayed as selected when the page loads, but that isn't really accurate, and can cause some weird refreshing behavior you have seen in the editor. My guess is you would prefer to show all the results at first and allow the User to filter if they want by selecting a number.
So now that the stock filter is gone and the number of children filter is updated, it seems the View block editor is working more like I would expect. I think you were seeing a lot of weirdness that is only apparent when the View produces no results and at the same time you are trying to edit the design for the results. The normal workflow here would be to temporarily create conditions that produce results.
So now that we've got the View showing some results, and the View editor is a bit less clunky when there are results to work with, can you please take a look and let me know if you see anything that is still obviously broken? Next we can look into the stock filtering that I removed earlier for testing purposes.
Thanks Christian.
My reply: hidden link
I do see the one expected result on the original homepage. Now need to add back in the nested view and (preferably) get away from using gutenberg to build the loop itself.
2nd issue I'm including here for the sake of time due to the delay in the back and forth/time zones, etc.
hidden link
Thank you thank you for your help! I definitely need it. Tight timeline. and lots of families depending on this event for their Christmas!
""2:20 - "That means I can't use the block editor".
Some clarification for you. Let's say you originally build some new View completely in the Block Editor. What is not currently possible is dragging a new View block into the loop of that View and creating your nested View directly there in the Block Editor. That is the limitation you should be aware of. However, you're pointing at the "Block Editor" button above the loop template editor panel. This gives you the ability to design the loop template, the portion that repeats, in the Block Editor. That is still possible in any case, the limitation does not apply to this button. The limitation is only about creating a nested View in situ, or in place, in the Block Editor.""
Ok - this makes sense now. I actually dont want to use the block editor (I strongly dislike it!). I'd love to avoid it if possible. I believe that may be why last year I created the classic version. But it seems to me the block version is/was being used on the real home page.
*****
A few moments ago I added a default label to the Classic View -> # of children, but still no results here:
hidden link <- because this uses Classic I *think* this is the version I ought to be using(?)
*****
I would prefer to show all results first (with pagination since there will end up being hundreds of families displayed in the loop results) and let 'shoppers/sponsors' narrow down in order to find a family that fits their budget.
******
Next step is adding back the Nested View that pulls an image at random and uses it as the featured image for the product.
Clicking a product card then takes the user to the product-single which should also have a random featured image in the hero. See my 4th video for more on this.
A few moments ago I added a default label to the Classic View -> # of children, but still no results here:
hidden link <- because this uses Classic I *think* this is the version I ought to be using(?)
You are correct that this View was built in the classic / legacy editor. You can tell by editing the home-copy page here:
hidden link
Hover over the View block, and you'll see a message like "This is a preview of some View - Edit in classic editor". (screenshot legacy-preview.png) Click that link and you'll see the legacy View editor open up and you can edit this legacy View here:
hidden link
So the changes you make in this View editor will appear on the front-end of the site here:
hidden link
As far as the reason why there are still no results, I see a Query Filter for Stock Status checking for a number greater than 0. For now, I would delete that filter. Stock Status is not numeric, it's a string like "instock", "outofstock", or "onbackorder". Stock Quantity is supposedly a numeric value. However, there have been some changes in how Toolset handles stock counts recently and I'm asking my team leader for the best answer on stock filtering. I'll let you know what I find out. In the meantime, delete the quantity filter to see results as expected.
Be sure you see the message that says "Pagination combined with random ordering can lead to same items appearing in more than one pages. It's recommended not to combine pagination with random ordering, unless unexpected results are acceptable." It sounds like you have a large enough number of posts that this shouldn't be too much of a problem, but something you should be aware of anyway.
In your video around 0:35 you're talking about nesting a View inside a Container. I see an issue where you cannot select a container to add contents, it looks like something is overlapping it. Normally when I have a problem like this I select the container in the sidebar navigator and hover over the container block in the main editor. That shows a little toolbar above the container block, and it has two arrow icons for up and down. I use those icons to move the container up or down temporarily so it's in a different position. If that doesn't work, I try moving the element that was covering up the container (the container below the container you want to select). Just reposition things briefly to make changes.
As far as the actual View nesting process, as I mentioned earlier it's not possible to create a nested View using nested View blocks in the Block Editor. But you can still drop a legacy View shortcode in a custom HTML block or something similar:
[wpv-view name="your-view-slug"]
Update: I think I 'solved' the issue with my elementor Product single template by deactivating the Toolset Woocommerce Blocks plugin: hidden link
I'm not sure (yet) what this plugin does or if I actually need it.
Hi Christian,
Just checking in. Can you let me know if you're still working on this ticket (e.g. re: the stock filtering question that you said you'd ask your team lead about) or if I've exhausted all the help I can get here and need to look elsewhere?
I do appreciate all your help so far. I've made progress. More issues remain however and I continue to need assistance. If I need to hire someone I need to do that sooner than later.
Thanks
Can you let me know if you're still working on this ticket (e.g. re: the stock filtering question that you said you'd ask your team lead about) or if I've exhausted all the help I can get here and need to look elsewhere?
Hi, I was checking to see the best way to handle stock queries but didn't get all the information I need. It seems there are two different ways to check that information as provided by WooCommerce. I was able to get information about simple products, so I can share that with you. For simple products (without variations), where stock is managed at the product level, you have two different stock indicators in the database. These indicators are in each product's hidden postmeta fields Stock and Stock Status, and have the slugs _stock and _stock_status, respectively. The value of _stock is an integer corresponding to "Stock quantity" in the product editor screen. The value of _stock_status is one of 3 possibilities: "instock", "outofstock", and "onbackorder". So to also filter your View by stock status, the solution depends on what exactly you want to test. If you want to check to see if there is at least a specific quantity of a simple product in stock, you could set up a filter for _stock and test based on an integer. For example, it you want to be sure there are at least 10 items in stock, you would set up a Query Filter for _stock >= 10. Your previous setup was testing Stock Status, not Stock, so an integer test is not appropriate. You should test not for an integer value but for the string "instock" to confirm a simple product is In Stock.
: I think I 'solved' the issue with my elementor Product single template by deactivating the Toolset Woocommerce Blocks plugin...I'm not sure (yet) what this plugin does or if I actually need it.
The Toolset WooCommerce Blocks plugin gives you the ability to use Toolset to design the Single Product template, the Shop template (i.e. the Products WordPress Archive), and WordPress Archives for WooCommerce Product taxonomies like Product Categories. There are some other features built-in as well, like blocks for displaying WooCommerce product galleries, the "Add to cart" button, etc., but if you'd prefer to use Elementor or another page builder to design these WooCommerce pages, you may not need the Toolset WooCommerce Blocks plugin.
Thank you Christian.
1.) The Toolset Woocommerce Blocks plugin appears to conflict with Elementor woo single product template override so I have deactivated it and updated my View. Solved.
2.) Regarding stock, all my products are simple, with stock managed at the product level. In my case, Product = "a family to be sponsored for Christmas". So if they are unsponsored, they are 'instock' and should be included in the View query results. They have a stock inventory of 1. Never more than 1. If they are sponsored they are 'outofstock' and have a inventory of '0' and should be hidden/not included in the query result.
Last year I had to filter out the outofstock products because they were being included in the query results. I did this by filtering on a 'stock quantity > 0'. Now, per your suggestion, I am attempting to filter:
The field Product In Stock Status is a STRING that is EQUAL TO the constant 'instock'
but this is not working. I could use your help on this. I *think* related to this is a blank (white) 'card' appearing in the query results. This blank card was not there prior to our removing the stock filter.
3.) This year I am including the Woocommerce Donation plugin to add an option for Sponsors to make an additional cash gift. This plugin is adding a product to the query results that I don't want in the query results. Its post ID is 4454. However when I add the query filter:
'Exclude posts with the ID of 4454' this does not filter this product from the query results. I could use your help with this.
That may be it (hopefully).
You still have admin access so please feel free to log in and inspect. Thank you again for your assistance.
Hello there! Christian won't be available. If you don't mind, I'll continue with you on this ticket.
Unfortunately, I do not have access to your website, and I don't find any private reply where you shared credentials earlier. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
Regarding the query filter for stock status, I think that you have chosen the wrong field. Choose "Stock status" instead of "Product In Stock status". Check this screenshot from my test install hidden link
If you don't have the "Custom field - Stock status" in the filter selection, go to Toolset->Settings->Front-end Content(tab)->Hidden fields, and add the "_stock_status" field. Reload the view and try again to add the query filter.
Regarding excluding the product "4454" try to deactivate the option "Don't include current page in query result" in the view and try again. If it does not work, we may find a solution using custom code. Let me know and I'll check it.
I would like to add that the Blocks editor is not yet a stable editor, and every component(theme+plugins) can add overhead and may cause compatibility issues. Currently, from Toolset's perspective, it does not offer the full features that Classic(or legacy) editor offers. If you are comfortable with the legacy editor, please continue using it.
If, you want to keep playing with blocks, and create nested views, I think that you have understood the workaround 🙂 Use a content template as an intermediary between the parent and child/nested view. I mean, build the child/nested view in a content template, then include the content template inside the parent view's loop.
I'll remain at your disposal.
Jamal - to be clear, the View that I am using is the classic view #3888
hidden link
I do not like the block editor/toolset blocks and would prefer not to use them at all.
thank you
My apologies for missing the URL link. Not often uses use them to share login to their websites.
To debug this issue, I have activated the views debug tool in Toolset->Settings->Front-end Content. And I get the debug information of the view. Because WPML is activated, the query becomes a little bit complicated. So, I temporarily deactivated WPML to check what's happening, then the homepage did not display the view at all, and the debug tool did not reveal any useful information about the view.
I would like to perform some tests that are irreversible, such as deactivating plugins, checking if WPML assigned language information to elements correctly, or some cleanup. I wonder if I can perform these operations on the provided site hidden link
I might also need a copy of your website for some local debugging. Would you allow me to take the copy?
Yes please proceed.
I have a backup from yesterday in case of serious issue.
The site is currently behind a 'coming soon' page, so in a sense it is still in development mode. The launch day is Oct 1 so I am urgent to get this View working properly. This (and implementing WPML) is hopefully the last hurdle to cross.
I have no experience with WPML so it would not surprise me if I set it up incorrectly.
Thank you for your assistance
At this moment I found one issue. It is related to the product ID. You want to exclude the product 4454 while it is actually 4455.
The white block is caused by the markup of the view, especially the loop editor section. The class that you are using for the grid cells will apply the white background style. It is the "family-card" class. I assume that you will want to adapt its styles.
I hope I am not missing something. Let me know if there is anything else I can help with.
I forgot to tell you that I have created another view and another page for my tests. Maybe you want to delete them.