• Resolved kannyman

    (@ryankanwal)


    Hi guys,

    Could someone please help me with a small technical issue…

    I am using the woo commerce plugin and have just added the following ‘ hooks’ to my theme functions.php …

    add_action( ‘woocommerce_before_main_content’, ‘woocommerce_catalog_ordering’, 20 );

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

    I have done this in order to move the sort/drop down menu from the bottom to the top of my product archive pages. These hooks have been successful however the sort/drop down menu now also appears at the top on my single product pages!!!

    you can see what i mean in this link….

    http://www.good-natured-gifts.com/shop/recycled-peroni-beer-bottle-glasses/

    Could someone please find a way to keep the sort/drop down menu at the top on my product archive pages but remove it from all single product pages….

    Please provide some custom CSS if possible.

    Many thanks in advance.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Have you already solved it? I can’t see any drop down menus at your single product page…

    Thread Starter kannyman

    (@ryankanwal)

    Yes I have thanks…..

    I played around with some styles and came up with this….

    .single-product .woocommerce_ordering {
    display: none;
    }

    I hope this can help anyone else with the same issues.

    add_action( 'woocommerce_before_main_content', 'woocommerce_catalog_ordering', 20 );

    should be

    add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 20 );

    I haven’t tested this, but I’m pretty sure that main_content outputs on everything including single.

    All mentioned before didn’t work in my case. I’m sure the one WP installation isn’t the other. So fist some basic install information:

    WP-Core
    WordPress 3.5.1 (US –> NL)

    Plugins:
    Akismet door Automattic versie 2.5.7,
    Booking Calendar door wpdevelop versie 4.0.2,
    CodeStyling Localization door Heiko Rabe versie 1.99.30,
    Disable Comments door Samir Shah versie 0.8,
    FormBuilder door TruthMedia Internet Group versie 0.91,
    Print Friendly and PDF door Print Friendly versie 3.2.0,
    Product Enquiry for WooCommerce door WisdmLabs versie 0.1,
    Testimonials door WooThemes versie 1.2.1,
    WooCommerce Admin Bar Addition door David Decker – DECKERWEB versie 2.4,
    WooCommerce Dynamic Gallery LITE door A3 Revolution versie 1.0.9,
    WooCommerce door WooThemes versie 2.0.0-RC1,
    WooCommerce Variation Details on Page Product door Marco Pereirinha versie 2.0.3,
    WooCommerce door WooThemes versie 1.6.6,
    WooDojo door WooThemes versie 1.5.2,
    WooSidebars – Sidebar Manager to WooSidebars Converter door WooThemes versie 1.1.1,
    WooSidebars door WooThemes versie 1.2.1,
    WP-Mail-SMTP door Callum Macdonald versie 0.9.1

    Theme
    Wootique 1.6

    I added the following hooks into Wootique theme at:
    /wp-content/themes/wootique/functions.php

    Add in this file in the specific reserved place:

    // DISABLE Default Product Sorting START
    remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_catalog_ordering’, 30 );
    // DISABLE Default Product Sorting END

    I hope for you dat this will work too in your installation.

    As a newbee in this PHP/CSS/… area I hope I didn’t course other problems. For now…no problems. Addition information is always welcome to come to a higher level of IT-skills! Thanks.

    MAHuijser:

    I’ve never used Wootique, but that theme may be coded to place the ordering in specific locations. By default, WooCommerce only places the pagination and drop-down ordering after the shop loop. So, unless Wootique adds pagination/ordering before all of the products, then
    remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
    does nothing… because it’s already not before the loop to begin with, it’s after. There’s no woocommerce_catalog_ordering there to remove. We are using
    add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 20 );
    to add the catalog ordering before the loop, as it by default is already after it.

    Treecycle is using

    remove_action('woocommerce_pagination', 'woocommerce_catalog_ordering', 20 );

    to remove the catalog ordering from after the loop, where it is by default. This is my understanding.

    dalemore,

    Thanks for your clear explination. I keep this in mind for a next time. Certainly if I’m going to use an other theme or built the UI myself.

    With kind regards,
    Marco.

    Chef

    (@splendidangst)

    Is there a way to remove the drop down “woocommerce-ordering” on a specific category page using css?

    In case anyone is trying to add the pagination (not the ordering) to the top of the shop, here is the fix:

    Insert this line
    <?php do_action('woocommerce_after_shop_loop'); ?>

    after this line
    <?php if ( have_posts() ) : ?>

    Hope this helps!

    Puiu.

    Hi MAHuijser
    Question I read that you use print friendly with WooCommerce. I have the problem, that the product images are only printed if the description consists only a few characters. If the text is longer I get no picture printed. But i am not shure.

    If i take wp e commerce, I dont have the problem but i dont like the available themes and layouts with wp e. it works on your side without problems ? Here are 2 links to a testsite

    http://hunde-bellen.eu/produkt/tshirt
    http://hunde-bellen.eu/produkt/copy-of-test
    You have an idea or maybe sombody else?

    thanks
    ralf

    This easy CSS solution worked for me:(installed the plugin: customCSS and then added:

    /*To remove Sorting drop down */
    .orderby {
    display: none !important;
    }

    Hope this helps someone 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How do I remove the drop down menu on single product pages (woo commerce)’ is closed to new replies.