Skip Navigation

[Resolved] Filters and prices not showing up

This thread is resolved. Here is a description of the problem and solution.

Problem: I'm trying to create a custom search WP Archive for Product Categories that allows filtering by global Product Attributes. When I have the option "Only show available options for each input" active, none of my global product attribute filters appear in the search filters area. If I disable the "Only show available options for each input" option, the filter options appear but they do not seem to influence the results. Product results are not filtered by Product Attribute filters.

In another issue, some Product prices do not appear in the archive results.

Solution: When importing Products, it is important to import the product attributes as taxonomies. Otherwise, these imported attributes will not be mapped to your site's global attributes correctly.

The price display issue seems to be related to the WooCommerce Blocks calculated fields batch process. Some posts are being skipped unexpectedly in the process. A patch file is available now that will resolve the problem. In the next round of plugin updates, we will be releasing some improvements to WooCommerce Blocks that will make this process and the patch file obsolete.

This support ticket is created 3 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 20 replies, has 2 voices.

Last updated by Marcel 3 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1992523

If you make the next reply private, I can sent you the feed link.
Any URL you share in the forum is hidden from public view for your security. No additional private fields are necessary to share a private URL.

By the way, can't I just load the WooCommerce price from the database, instead of the blocks filter field? I only saw this field as an option to show the price...
You can display the price value directly from the database instead of the calculated value, but the calculated price is important for Product listing features like sorting and filtering when price is involved. Also I don't think that field is reliable for variable products, so it's best to use the WooCommerce Blocks calculated field in a product list.

The second tier support team found a glitch in our batch process related to processing products that were imported into an existing site, and found a quick solution. You can find a patched file available here:
hidden link
Extract the PHP file Class_WooComerce_views included in the zip archive and upload it to your server replacing the file in the following location:

/plugins/woocommerce-views/Class_WooComerce_views.php

Then go to Toolset > WooCommerce Blocks and temporarily change the processing schedule to "Manually", then run the process to calculate the required fields. After the process is complete, you can revert to one of the WordPress Cron schedule options.

Our next round of plugin updates will include many updates to WooCommerce features, including a comprehensive update that will make this patch obsolete. After the next round of plugin updates, the missing price fields should no longer be an issue and the patch will not be required.

I'm still discussing the filtering issue with the team and will give you an update as soon as I have a clear understanding of the problem and solution.

#1992673

Hi Christian,

That seems to work, thanks 🙂

The feed link is hidden link, maybe it will help to solve the filter issue.

#1995523
Screen Shot 2021-03-21 at 9.10.17 PM.png
Screen Shot 2021-03-21 at 9.07.20 PM.png

Okay I have done some digging and the problem here does seem to be related to how the Product Attributes were imported with Products. There seems to be an attribute mapping problem. If you edit one of these Products you can see what I mean. For example, I am testing the archive here:
/product-categorie/hout/houtsoorten/
...and I'm editing one of those matching Products here:
/wp-admin/post.php?post=2615&action=edit
If you open up the Product Attributes panel, you can see a row for the attribute Bewerking, and the term "fijnbezaagd" is included. In order for the Product Attribute filter to pick up this term, it must be mapped to the actual Product Attribute, but it appears it is not correctly mapped.
If I add "Bewerking" as an attribute using the dropdown menu, I can select the Fijnbezaagd term using the system controls. When I add the term this way, the filter registers the attribute correctly, as you can see in the screenshots here. If I reload the page, I can see two rows for Bewerking again. In the row I created, the Fijnbezaagd term is shown in a "pill" form. This indicates the attribute and term are mapped to the Product Attribute "Bewerking" and the term "Fijnbezaagd" that can be found in Product > Attributes. This is how all the imported Product Attributes should be displayed. The term should appear in "pill" form, indicating the term is mapped to one of the Product Attribute terms from Product > Attributes. Otherwise, the term is not truly mapped to one of the filterable attributes. This is why your filters are not working correctly.

It seems that the Product Attributes were imported in a way that is not mapped to the Product Attribute terms stored in Product > Attributes. It seems that somehow they were imported as separate custom attributes rather than as the existing Product Attributes. Unfortunately I don't know enough about importing product attributes to be able to give you good advice here. There seems to be a difference between custom attributes and global attributes, but I'm not a WooCommerce expert. You may need to contact the support team for the plugin or import tool you used to import these products to see if there is a better way to map the attribute terms from the CSV file to the existing terms in the site. A quick search led me here: https://github.com/woocommerce/woocommerce/issues/19771
This might contain some helpful information, it sounds similar to what you're experiencing.

#1999251
taxonomy.png

Hi Christian,

Thanks again for your effort.

I've had contact with the support team from WP All Import, they advised me to import the attributes as a taxonomy. That worked, now the filters finally seem to work as expected 🙂

However, is there a way to have a different search filter block on mobile? For example, can I have checkboxes on desktop, but select dropdowns on mobile?

#1999491

You can apply different layout and styles at different screen resolutions, but the filter type must remain consistent. I think if you want to show different filter types at different screen resolutions, you would need to create two separate Views and use the responsive controls to show and hide the entire View at different screen sizes. That could have some performance impact though, since both Views would technically be present on the page even though one is hidden by CSS based on the screen size.

#1999501

Ok thanks again Christian 🙂

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.