Forums Forums Search & Filter Pro woocommerce sorting dropdown

Viewing 10 posts - 1 through 10 (of 11 total)
  • Anonymous
    #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.php do_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

    Trevor
    #97214

    If you are using the theme’s search.php, this will not have a woocommerce loop on it, and so that do_action will not trigger.

    Anonymous
    #116281

    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

    Trevor
    #116364

    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?

    Anonymous
    #116447

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

    Trevor
    #116458

    You know that this code:

    /**
    * woocommerce_before_shop_loop hook.
    *
    * @hooked woocommerce_result_count – 20
    * @hooked woocommerce_catalog_ordering – 30
    */

    does nothing? as it is treated as comments.

    Anonymous
    #116675

    This 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?

    Trevor
    #116794
    This reply has been marked as private.
    Ross Moderator
    #118799

    Hi 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 to WooCommerce Shop.

    Let me know if that works.

    Thanks

    Anonymous
    #118959

    Hi,
    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?

Viewing 10 posts - 1 through 10 (of 11 total)