Forums › Forums › Search & Filter Pro › Searching for Products with ACF fields (0 results)
Tagged: acf, No results, products, woocommerce
- This topic has 11 replies, 2 voices, and was last updated 5 years, 1 month ago by Trevor.
-
Anonymous(Private) September 19, 2019 at 5:34 pm #221393
I have created a few select fields inside Woocommerce products using ACF.
Then I built a Search Form using Post Meta fields with choice inputs for each ACF field – Auto Count enabled.
Now when I try to filter the products, it only shows (0) results on every ACF field available.
What am I doing wrong?Anonymous(Private) September 25, 2019 at 4:30 pm #221905Hey, I have found the problem but I couldn’t find a solution.
Some options were showing (0) results because they are VARIABLE PRODUCTS. So I checked to search Products and Variations on post types and it solved for Categories, but not ACF Fields.
Variable products can’t be filtered because the ACF field is in the product, not in the variation, and I can’t display the custom fields inside a veriation – this rule doesn’t exist in ACF.
Is there some way to use the custom fields in the product which the variation belongs to? It’s the only way it would work for me.
Thanks!
Anonymous(Private) September 26, 2019 at 4:35 pm #222050Yes, it works now! Thank you!
Just one more thing. Is it possible to have two Search Forms using the Display results method WooCommerce Shop? I haven’t tried it yet, but there was an error alert when I created two forms with this display method. I won’t be using them together, they will be in different pages.
Trevor(Private) September 26, 2019 at 4:52 pm #222052It is not possible, sorry. You must make one form with all fields that you need, and if, on certain pages, some fields are not needed, use custom CSS on those pages to hide the field(s). For example, every category page has the category name in the body tag class names that makes this possible.
-
AuthorPosts