Forums › Forums › Search & Filter Pro › woocommerce sorting dropdown
- This topic has 10 replies, 3 voices, and was last updated 7 years, 4 months ago by Ross.
-
Anonymous(Private) March 15, 2017 at 9:00 pm #97179
I am using woocommerce on my site.
I am using the search.php to display the results for my searches, not the woocommerce search results template. However I would like to use the woocommerce ‘sorting’ dropdown for the searchandfilter results page.
The shop pages uses the ‘sorting’ dropdown eg sort by popularity, sort by price low to high, sort by price high to low. I tried to add it to search.phpdo_action( 'woocommerce_before_shop_loop' );
but it doesn’t show on the page.
Is this compatiable to use with your plugin? If yes how can I get it to work?Thanks
Anonymous(Private) June 22, 2017 at 8:56 am #116281I 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.
ThanksAnonymous(Private) June 22, 2017 at 7:11 pm #116447Yes, the template is the standard Woocommerce archive-product.php template file which already includes the do_action( ‘woocommerce_before_shop_loop’ ); code.
Should it be in the woocommerce/archive-product.php path or directly as archive-product.php in the same folder as the style.css
I tried both but the hook- @hooked woocommerce_catalog_ordering – 30 doesn’t work in either place.Anonymous(Private) June 24, 2017 at 8:54 pm #116675This is how woocommerce is setup, the commented out code is just information.
The hook woocommerce_catalog_ordering is included in the action
do_action( ‘woocommerce_before_shop_loop’ );
except that it isn’t working.
If you look here: http://storenet.mgtestsite.com/?sfid=461&_sft_product_cat=laptop-computers-he
There is code for the filter under the page title but it is empty.
<div class=”storefront-sorting”></div>Why would it be conflicting with the seachandfilter plugin?
Ross Moderator(Private) July 4, 2017 at 10:05 pm #118799Hi Rena
Could it be that you haven’t set S&F to use the woocommerce shop?
I guess the shop sorting, by WooCommerce doesn’t work outside of the WC itself.
When I see a URL like: http://storenet.mgtestsite.com/?sfid=354&_sft_product_cat=laptop-computers-he&_sfm_calculated_price=100+13450
Then it looks like your
display method
is archive? You probably need to set it toWooCommerce Shop
.Let me know if that works.
Thanks
Anonymous(Private) July 5, 2017 at 7:25 pm #118959Hi,
If I set the display method to ‘woocommerce shop’ it works and everything is good. However, my issue is that I have MULTIPLE filters – one for computers / laptops / screens / printers etc.
And searchandfilter only allows me to use ‘woocommerce shop’ ONCE.
I get the error:
Error: There are 2 Search Forms using display mode WooCommerce Shop – you may only have 1
What should I do? How do I get the ‘filter by price’ to work for all the filter? -
AuthorPosts