AnonymousInactive
Wednesday I bought your fantastic plugin. Currently the filter running on the following url: http://bodywear.newfishdev.nl/shop. As you can see it works well except on two things:
1. When I select a category, the filter keeps showing me empty values in the other taxonomies. If you choose, for example, the category “Shirts”, the taxonomy “Brands” (merken) did not changed even the option “Hide empty terms” is turned on. Strange part is that I turned on the count option, and no matter what I check, the count doesn’t change at all.
2. The default sorting woocommerce doesn’t work anymore after using the filter.
If you need more details let me know.
Many thanks in advance! and keep up the good work.
This reply has been marked as private.
AnonymousInactive
Ross,
yes that is what I mean but I am not sure how and where to put it. Should I create a new JS file, add it to an existing one or can I do something with functions? Not very clever with JS.
Thanks
Hey Chris do you mean when AJAX has completed you would like the page to scroll to the top automatically?
In this case its quite simple you just need to add some JS to your theme:
$(".searchandfilter").on("sf:ajaxfinish",function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
});
Let me know 🙂
AnonymousInactive
Hi Ross,
Sorry I still need help on this.
When using AJAX for the search the pagination works… but the next page loads above the next buttons etc. I would like it to navigate back to the top of the page when I click next or a page selection but as it is AJAX I think it just loads the results above.
If I remove AJAX then the pagination links disappear completely and it only loads the 24 posts allocate to show.
Can you help me out on this one?
Sorry just to add.. if you are looking to do a dropdown or another input type other than number with post meta, then you will need to preload all the values and enter labels for them – use the “auto suggest” feature to auto detect values that are currently in use and populate your field with options for your users.
Thanks
Hey Robert, its pretty much the same as everything else, WooCommerce uses custom taxonomies for categories and tags so you just need to use taxonomy fields to display those.
If you have other attributes, then these will be post meta – however these do not work the same as taxonomies or categories for example, they require a bit more setting up.
First you’ll need to find the meta key that is used for the values you want to search, so for example if I wanted to add a field for price, then I would add a post meta
field to my search form UI, and then I would choose _price
as the meta key. Depending on how you want to display it you might choose a range slider, so I would choose the number type and the range slider.
If you’re not sure what the meta key is for the attribute you want to search, then I think the easiest way of figuring that out is to do a dump of your post meta. You could add the following in your loop in one of your templates to get a list of all meta keys / values for a specific post or a page of posts:
<?php
$post_meta = get_post_meta( get_the_ID() );
echo '<pre>';
var_dump($post_meta);
echo '</pre>';
?>
Does that make sense?
AnonymousInactive
I can’t seem to find any documentation on using this plugin with WooCommerce. The very basic search feature works, but I need some guidance on adding filtering for product attributes. Where do you find the values? Do you need to pre-load all values? etc.
Thanks
This reply has been marked as private.
AnonymousInactive
Got it working with the pagination now and Ajax after working hard with the CSS to get the pages to look the same.
Its definitely getting there now.
One thing I have been noticing… the item count doesnt ever update from the overall total. Should it when selecting products?