If I understand this correctly, you are using ‘As an Archive’ and specifying that template. Did you already add that do_action to the template?
Can I confirm that this is the standard WooCommerce archive-product.php template file?
AnonymousInactive
I tried setting the ‘display results method’ as woocommerce/archive-product.php and the template is being used but the ` <?php
/**
* woocommerce_before_shop_loop hook.
*
* @hooked woocommerce_result_count – 20
* @hooked woocommerce_catalog_ordering – 30
*/
do_action( ‘woocommerce_before_shop_loop’ );
?>
is not showing the catalog sorting dropdown with the ‘display price high to low, most popular etc’.
If I choose ‘display results’ as WooCommerce Shop then it does show the catalog_odering. But it only allows me to use this woocommerce shop display once and I have multiple filters.
How can I set up the template to be used to make sure it also shows the woocommerce_catalog_ordering?
I’m using the storefront theme.
Thanks
AnonymousInactive
I think I have to change archive-product.php, but how do I do that?
AnonymousInactive
Hello again!
I have now updated the page so that the search shortcode is added to the archive-product.php and it seems to work better now.
However, if I chose something from all three taxonomies I still get a result, even though I picked the first two taxonomies that contain zero results.
Will add instructions and URL in a private reply below.
Regards
AnonymousInactive
Hm no, that page is the search page only, with the shortcode.
The result page is using archive-product.php with our modifications.
Is that helpful? 🙂
Hi Daniel
I took a look and S&F seems to be working ok – I placed the form on another page:
http://zdolnelapy.pl/projekty/katalog/shop-form-test/ – and as you can see, when you use it, it takes you to the shop with the correct search results.
Now the question is, how can you add the search form to your shop page? I cannot see any sidebar / widget area to add this – so this really is a theme restriction – not allowing things to be added to the shop page.
In this case, you must edit the template file for displaying the shop – and add the shortcode in there.
The shop is usually displayed using the template file woocommerce/archive-product.php
so you must edit this file (in your theme) and add the S&F form to that page – something like:
<?php echo do_shortcode("[searchandfilter id='2800']"); ?>
I hope that makes sense.
Thanks
You results container is set to #main
(in the display results tab)
The results container shoudl only contain your results, but yours, also contains the search form itself.
This means, when there is an ajax request, the search form is replaced, an no longer works correctly.
What you probably need to set this to is .archive-products
Check the docs on the correct way to setup ajax:
https://www.designsandcode.com/documentation/search-filter-pro/search-results/#Setting_Up_Ajax
Thanks
Hey Mark
You can creat a completely seperate page for your search results – but it won’t pick up the woocommerce layouts automatically – you’ll likely have to do some tinkering with the templates – but they are completely customisable if you know what you’re doing.
So instead, simply follow the steps here for displaying results with a shortcode:
http://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/
Make sure to follow the part about customising the template, because this is where all your layout/loop code will go.
There is another option yet, to use the archive method, and use the WooCommerce archive-product.php
but then will likely still need some tweaking – http://www.designsandcode.com/documentation/search-filter-pro/search-results/as-an-archive/
Thanks
Hi there
To answer your questions:
1) The count numbers are not dynamic and do not reflect the real live values based on the current search – they are based on WP internal count of these taxonomies – the next version of S&F will change this and they will be dynamic.
2) S&F works with WooCommerce, in that you can search WooCommerce Products, and search attributes and custom fields – but it is not a filter to be used with the Shop page directly (I will add this at some stage).
You need to think of this a little different, so on your shop page you can add the S&F form, but realise, once a user searches – they will be taken “away” to a search result page.
Now what you must do is recreate the format of the shop page if that is what you wish.
If you are using Display using shortcode, then you should just paste the shortcode in to an empty page – and have the Results URL point to this new page. You will then have to customise the html/css to emulate the look of your shop page.
Alternatively, you could try using the As Archive method – the WooCommerce product archive is usually calls the WooCommerce template archive-product.php
and you could try modifying using this with some modification for your S&F results.
Some other users have across this see here – https://support.searchandfilter.com/forums/search/archive-product/
Thanks