Viewing 11 replies - 1 through 11 (of 11 total)
  • you just need to edit the archive-product.php template file
    or, you could add this to your themes functions.php:

    remove_action('woocommerce_pagination','woocommerce_catalog_ordering');
    add_action('woocommerce_before_shop_loop','woocommerce_catalog_ordering');
    Thread Starter mariaarty

    (@mariaarty)

    thanks for answering, but this code added a sorting over the product but it didn’t remove the one under them, now i have 2

    Thread Starter mariaarty

    (@mariaarty)

    i have added this code in the woocommerce-template.php

    /**
    * Replace WooCommerce Default Pagination with WP-PageNavi Pagination
    *
    */
    remove_action(‘woocommerce_pagination’, ‘woocommerce_pagination’, 10);
    function woocommerce_pagination() {
    wp_pagenavi();
    }
    add_action( ‘woocommerce_pagination’, ‘woocommerce_pagination’, 10);

    could this be why it doesn’t remove the one under the page?
    and i tried to edit in the archive-product.php, but nothing really happens, thanks for your help…

    Thread Starter mariaarty

    (@mariaarty)

    hey guys i would really love to get red of the bottom sorting, any help….

    also does anybody knows how to remove this sorting from the category pages, i only have 2 categories and i don’t need the sorting there, and diffenetly not 2 😛

    any help, thanks

    you should probably change your function name to something that doesn’t overlap with an action name to avoid confusion, but the reason the one at the bottom isn’t going away is because you’re not removing it. This is w hat you need to remove the one at the bottom.

    remove_action(‘woocommerce_pagination’,’woocommerce_catalog_ordering’);

    Thread Starter mariaarty

    (@mariaarty)

    if ( ! function_exists( ‘woocommerce_catalog_ordering’ ) ) {

    /**
    * Output the product sorting options.
    *
    * @access public
    * @subpackage Loop
    * @return void
    */
    function woocommerce_catalog_ordering() {
    if ( ! isset( $_SESSION[‘orderby’] ) )
    $_SESSION[‘orderby’] = apply_filters( ‘woocommerce_default_catalog_orderby’, get_option( ‘woocommerce_default_catalog_orderby’ ) );
    woocommerce_get_template( ‘loop/sorting.php’ );
    }
    }

    this is the code in the woocommerce-template.php
    i don’t know how to stop showing this sorting, this code doesn’t remove the sorting, the add_action works but the remove doesn’t

    so any ideas…?

    I just confirmed this works:

    remove_action(‘woocommerce_pagination’, ‘woocommerce_pagination’, 20);

    Thread Starter mariaarty

    (@mariaarty)

    still doesn’t remove it 🙁

    I found solution!
    To get rid of the bottom sorting, just add to your themes functions.php:

    remove_action(‘woocommerce_pagination’,’woocommerce_catalog_ordering’, 20);

    It just adde another drop down in bottom of page. It doesn’t remove old one or insert new on top.

    Maybe this worked on previous versions of woocommerce, does anyone now how to do it for latest version?

    I know this is a bit old, but I just had a similar niggle, so thought I’d respond. In order for the remove to work, you have to specify correctly where ‘woocommerce_catalog_ordering’ is hooked.

    If you tried this:
    remove_action('woocommerce_pagination','woocommerce_catalog_ordering', 20);

    and it didn’t work, then that’s probably because your ‘woocommerce_catalog_ordering’ isn’t hooked onto woocommerce_pagination, or if it is, it isn’t hooked at position 20.

    The reason this worked for other people but not for you is probably that their theme did have ‘woocommerce_catalog_ordering’ hooked at that position.

    What I did was look in woocommerce/template/archive-product.php where I saw on line 40 that woocommerce_catalog_ordering was hooked at position 30 to woocommerce_before_shop_loop. I doublechecked this against woocommerce-hooks.php, and yes, there was ‘woocommerce_catalog_ordering’at position 30, and nothing anywhere else changing that.

    So, what worked for me was:
    remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering',30);

    This probably won’t work for you, because your form is at the bottom, so it probably isn’t hooked to woocommerce_before_shop_loop. You need to find out what it is hooked onto, and where. I suggest you do a global search for woocommerce_catalog_ordering – probably somewhere in your theme, will be a line that says something like :

    add_action( 'functionhookedto', 'woocommerce_catalog_ordering', 30 );

    Once you’ve found that, you should be able to unhook it in your functions.php. I hope that makes sense!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘moving the product sorting above the products’ is closed to new replies.