Hello Summer Sale!
Exclusive season-opening discount on TheGem theme.
Limited time offer.

Okay
  Public Ticket #1543603
Removing Sorting and pagination from pages
Closed

Comments

  • Eilerp started the conversation

    How can I remove the sorting drop down and the pagination plus the message of the total amount of products that show on the top of the product listing?

    I want to remove this code from the template: 

    <div class="before-products-list rounded-corners clearfix"><form class="woocommerce-ordering" method="get">
    <select name="orderby" class="orderby">
    <option value="menu_order" selected="selected">Default sorting</option>
    <option value="popularity">Sort by popularity</option>
    <option value="rating">Sort by average rating</option>
    <option value="date">Sort by newness</option>
    <option value="price">Sort by price: low to high</option>
    <option value="price-desc">Sort by price: high to low</option>
    </select>
    <input type="hidden" name="paged" value="1">
    </form>

    <div class="woocommerce-select-count">

    <span class="combobox-wrapper"><span class="combobox-text">Show 12 On Page</span><span class="combobox-button"></span><select id="products-per-page" name="products_per_page" class="gem-combobox" onchange="window.location.href=jQuery(this).val();" style="opacity: 0; position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px;">

    <option value="/?product_count=12" selected="selected">Show 12 On Page</option>

    <option value="/?product_count=24">Show 24 On Page</option>

    <option value="/?product_count=48">Show 48 On Page</option>

    </select></span>

    </div>

    <p class="woocommerce-result-count">
    Showing 1–12 of 120 results</p>
    </div>



    Thank you in advance.

  •  7,280
    Oliver replied

    Hi,

    Add this code to the fucntions.php of the child theme:

    function delay_remove() {
        remove_all_actions('woocommerce_before_shop_loop');
    }
    add_action('init','delay_remove');
    

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • Eilerp replied

    that also removes the left column from the page, see attached image 

  •  7,280
    Oliver replied

    Hi,

    Add this:

    function delay_remove() {
        remove_action('woocommerce_before_shop_loop', 'thegem_woocommerce_before_shop_loop_start', 11);
        remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 15);
        remove_action('woocommerce_before_shop_loop', 'thegem_woocommerce_product_per_page_select', 30);
        remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 40);
        remove_action('woocommerce_before_shop_loop', 'thegem_woocommerce_before_shop_loop_end', 45);
    }
    add_action('init','delay_remove');
    

    And remove old one.

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver