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 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 ago.

Assisted by: Christian Cox.

Author
Posts
#1988831

I'm building a product category page and I have a few questions:
- I added search filters, but the filters don't show up.
- Also, a certain category doesn't show the prices.
- How do I show variable prices instead of a calculated average with variable products
- I would also like to hide the entire form group when there are no active filters in that category so I don't see the headings either

You can see the problem here: hidden link

#1989327
manual-calculation.png
block-navigation.png

- I added search filters, but the filters don't show up.
Hello, this could be caused by a configuration option in the View settings if no active filters are available for this search. Please select the top-level View block and look in the block settings sidebar. Open the "Custom Search" panel and look for the toggle "Show only filter options that would produce results". If this option is turned "on", try turning it "off" (see block-navigation.png). Does this solve the problem? If not, something else must be happening. I will need to take a closer look.

- Also, a certain category doesn't show the prices.
Perhaps these calculated product fields have not been calculated yet? Please go to Toolset > WooCommerce Blocks and look in Products Fields for Parametric Searches. Switch to "Manually" temporarily and trigger a calculation update (see manual-calculation.png). After calculating manually, switch back to "Using the WordPress cron" and choose the calculation frequency you desire. Or if you have a system cron set up with your hosting company, switch to "Using a system cron, by calling this URL:", but most people use the WordPress cron option.
If this does not solve the problem, please explain how the price field is added to the View results. Are you using a specific block, or a shortcode? Please provide a screenshot if possible.

- How do I show variable prices instead of a calculated average with variable products
Normally the WooCommerce Blocks Price block will display a range, not a calculated average, of the minimum and maximum variation prices. That is the standard WooCommerce price behavior for variable products, and Toolset's price block is based on that standard behavior. For example it will display €10,00 - €15,00 for a product with 3 variation prices €10,00, €11,00, and €15,00.
If you want to display all the variation prices like €10,00, €11,00, €15,00, that would require some custom code.

- I would also like to hide the entire form group when there are no active filters in that category so I don't see the headings either
There's nothing exactly like this built-in to the system, but you could use a bit of JavaScript to handle this. Once the problem with filter display is solved, try adding this code in the View's Custom JS editor:

function hideEmptyFilterLabels() {
  jQuery('.wpv-custom-search-filter__input').each(function(index,item) {
    $item = jQuery(item);
    if($item.html() == '') {
      $item.closest('.form-group').hide();
    }
  });
}
jQuery(document).ready(function(){
  hideEmptyFilterLabels();
});
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
 hideEmptyFilterLabels();
});

That should hide the empty filter groups when the page loads and again when the search form is updated with AJAX if necessary.

#1989403

Hi Christian,

Thanks for your respons, but did you see the screen recording video? Then you should have seen that the attributes I'm trying to filter on are filled in with a certain product, but the filters aren't shown. When I set the switch to off, it does work, but the whole reason we're using Toolset on this site is to only show the filters that belong to the current category (every category has different filter options).

Same with the prices problem: in one category, prices are shown, but in another category - with the same template - they're not shown.

So if you would take a look, please. If you make the next reply private, I'll provide you with a login.

#1989429

Yes, I did watch the video, and I need some closer examination in wp-admin to understand the problems you are experiencing. Private reply fields are available here for your reply.

#1989667

Okay I've been looking through your site and I see that the construction of the Product Category archive is somewhat unusual. In the Toolset environment, normally you would design the Product Category archive using a Toolset WordPress Archive assigned to the Product Category archive, and in Toolset > WooCommerce Blocks you would choose "WooCommerce Views plugin default product archive template " for Product Archives. Then you would create archives for Product Categories and the main Shop page in Toolset > WordPress Archives. Instead, you have created an Elementor template for the Product Category archive, and inserted a View via a Content Template, instead of using Toolset's WordPress Archive feature.

In general, Toolset's Content Templates and Elementor templates have issues when used together, and I suspect that is part of the problem here. If I edit your View and delete the taxonomy Query Filter "Product categories the same as the current archive page", the filter options appear again, but the results are not filtered by taxonomy as expected.

So to continue, I would like to try creating this Product Category archive with custom search as a Toolset WordPress Archive. Then I would like to turn off the Elementor Template for the Product Category archive, and see if the filters work as expected when the option "Show only filter options that would produce results" is active.

If you agree, I will try that. Note that in this scenario, you would also need to create the main Shop page archive using Toolset's WordPress Archives. Let me know if you would like for me to proceed.

#1989671

Hi Christian,

Sure, you can do that, no problem.

#1990203

Hi Christian,

Since you didn't get to it yesterday, I decided to rebuild the archive myself. Unfortunately, it still doesn't work. However, there's a strange thing: on the shop page, which is on /winkel/, the filters DO work fine. However, on the product category archives, they don't.

When I set the switch "Show only filter options that would produce results" to off, the filters are shown, BUT they don't work... when I try to filter, it says there are no results. On the shop page, the same filter does produce results for the same filter, in that category.

Please see this screen recording: hidden link

Oh and prices aren't displayed correct either. see this screen recording: hidden link

#1990947

Okay thanks for the update. My shift ended yesterday before I got a chance to investigate further, so these videos are helpful. I think the next step is for me to try to reproduce this issue in my local environment to see if the problem is specific to your site or replicable in a similar setup. To do that, I would like to create a clone of your site using the All-in-One WP Migration plugin.

Let me know if you approve and I'll get started as soon as I can. Thanks for your patience and understanding.

#1990957

Sure, no problem. Thanks for your effort 🙂

#1991223

Thanks, I have created the site clone and I was able to install it on my local environment, so feel free to delete the migration plugin if you would like. I'm running tests now and will give you an update shortly.

#1991391

Okay the problem with filters not working as expected in Product Categories is replicable in my local environment and I don't see anything obviously wrong here. Let me ask my 2nd tier support team for some feedback. If it is possible to filter by product attributes, I'll find out what is wrong in the current setup. If it is not possible to filter by product attributes, we should try to remove this option from custom search filters as it is misleading.

I'll let you know what I find out about that.

I'm still investigating the prices not appearing as expected, and will give you another update before the close of my shift today.

#1991397

Hi Christian,

Thanks again for the effort. Filtering on product attributes IS possible though, it works fine on the /winkel/ page*. Just not on the product category pages.

* Well, not entirely... for example, the filters for "Product Breedte in cm" en "Product Dikte (cm)" aren't working either on the /winkel" page, even though the options do get loaded in the backend.

If it helps, the products and attributes are imported via WP All Import, but they look the same as a normal WooCommerce product in the backend. They might be stored differently in the database or something?

#1991507

I was able to determine that the missing prices are related to WooCommerce Blocks filter fields, which are not being calculated as expected for some Products. Normally you can go to Toolset > WooCommerce Blocks and trigger a batch process that calculates certain values like Price and stores them as custom fields. This makes sorting and filtering Views and Archives of Products work faster and more efficiently. However in your site, when I run the batch process, some Products seem to be getting skipped during the process. I'm not quite sure why, and I've asked my second tier team to investigate. You mentioned that Products were imported, and I'm curious to know if that could be related to the batch process problem. For example, Product 1831 and Product 1832 are both skipped by the process. However, Product 3003 has these fields calculated in the database already. If you edit Product 1831 directly in wp-admin and save any change, the WCB fields will be calculated as expected and that Product's price will begin to appear in the archives.

Do you have any more information about the import process for Products? Did you import all the Products at the same time, or in separate batches? Do you still have the CSV files you used to import Products? Can you share those?

#1991803

Hi Christian,

If you make the next reply private, I can sent you the feed link.

#1991995

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...

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