Skip to content
ArtofData Web Design Agency - Digital Agency - SEO Search engine optimisation - Graphic Design - Reading Berkshire
  • Home
    • About
  • Our Work
    • Retail Website Designers – Cheese-etc
    • Online application design: Walk The Thames
    • Nursery school web design: Little Oaks Nursery
    • Building Services Group
    • Norrie Carr
    • Wallrite
    • InvictaNet
    • Insta Attire
    • ELP Electrical
    • TS Cars and Son
  • Digital Services
    • Brochure Website Design
    • Web Design
    • What is WordPress?
    • WordPress Plugin Developers
      • “What is woocommerce?”
      • Sequential Invoice Numbers Plugin
      • WordPress Plugin Authors
    • Elementor Pro
    • Ecommerce
      • Retail clothing websites
    • SEO Reading
    • SEO Content Writing
    • Social Media
    • Website Hosting
  • Blog
  • Shop
    • Domain Names
    • UK Web Hosting
  • Contact
    • Website Design Questionnaire
Menu
  • Home
    • About
  • Our Work
    • Retail Website Designers – Cheese-etc
    • Online application design: Walk The Thames
    • Nursery school web design: Little Oaks Nursery
    • Building Services Group
    • Norrie Carr
    • Wallrite
    • InvictaNet
    • Insta Attire
    • ELP Electrical
    • TS Cars and Son
  • Digital Services
    • Brochure Website Design
    • Web Design
    • What is WordPress?
    • WordPress Plugin Developers
      • “What is woocommerce?”
      • Sequential Invoice Numbers Plugin
      • WordPress Plugin Authors
    • Elementor Pro
    • Ecommerce
      • Retail clothing websites
    • SEO Reading
    • SEO Content Writing
    • Social Media
    • Website Hosting
  • Blog
  • Shop
    • Domain Names
    • UK Web Hosting
  • Contact
    • Website Design Questionnaire
  • 0118 942 0101
ArtofData Web Design Agency - Digital Agency - SEO Search engine optimisation - Graphic Design - Reading Berkshire
  • Home
    • About
  • Our Work
    • Retail Website Designers – Cheese-etc
    • Online application design: Walk The Thames
    • Nursery school web design: Little Oaks Nursery
    • Building Services Group
    • Norrie Carr
    • Wallrite
    • InvictaNet
    • Insta Attire
    • ELP Electrical
    • TS Cars and Son
  • Digital Services
    • Brochure Website Design
    • Web Design
    • What is WordPress?
    • WordPress Plugin Developers
      • “What is woocommerce?”
      • Sequential Invoice Numbers Plugin
      • WordPress Plugin Authors
    • Elementor Pro
    • Ecommerce
      • Retail clothing websites
    • SEO Reading
    • SEO Content Writing
    • Social Media
    • Website Hosting
  • Blog
  • Shop
    • Domain Names
    • UK Web Hosting
  • Contact
    • Website Design Questionnaire
Menu
  • Home
    • About
  • Our Work
    • Retail Website Designers – Cheese-etc
    • Online application design: Walk The Thames
    • Nursery school web design: Little Oaks Nursery
    • Building Services Group
    • Norrie Carr
    • Wallrite
    • InvictaNet
    • Insta Attire
    • ELP Electrical
    • TS Cars and Son
  • Digital Services
    • Brochure Website Design
    • Web Design
    • What is WordPress?
    • WordPress Plugin Developers
      • “What is woocommerce?”
      • Sequential Invoice Numbers Plugin
      • WordPress Plugin Authors
    • Elementor Pro
    • Ecommerce
      • Retail clothing websites
    • SEO Reading
    • SEO Content Writing
    • Social Media
    • Website Hosting
  • Blog
  • Shop
    • Domain Names
    • UK Web Hosting
  • Contact
    • Website Design Questionnaire
  • 0118 942 0101
ArtofData Web Design Agency - Digital Agency - SEO Search engine optimisation - Graphic Design - Reading Berkshire
  • Home
    • About
  • Our Work
    • Retail Website Designers – Cheese-etc
    • Online application design: Walk The Thames
    • Nursery school web design: Little Oaks Nursery
    • Building Services Group
    • Norrie Carr
    • Wallrite
    • InvictaNet
    • Insta Attire
    • ELP Electrical
    • TS Cars and Son
  • Digital Services
    • Brochure Website Design
    • Web Design
    • What is WordPress?
    • WordPress Plugin Developers
      • “What is woocommerce?”
      • Sequential Invoice Numbers Plugin
      • WordPress Plugin Authors
    • Elementor Pro
    • Ecommerce
      • Retail clothing websites
    • SEO Reading
    • SEO Content Writing
    • Social Media
    • Website Hosting
  • Blog
  • Shop
    • Domain Names
    • UK Web Hosting
  • Contact
    • Website Design Questionnaire
Menu
  • Home
    • About
  • Our Work
    • Retail Website Designers – Cheese-etc
    • Online application design: Walk The Thames
    • Nursery school web design: Little Oaks Nursery
    • Building Services Group
    • Norrie Carr
    • Wallrite
    • InvictaNet
    • Insta Attire
    • ELP Electrical
    • TS Cars and Son
  • Digital Services
    • Brochure Website Design
    • Web Design
    • What is WordPress?
    • WordPress Plugin Developers
      • “What is woocommerce?”
      • Sequential Invoice Numbers Plugin
      • WordPress Plugin Authors
    • Elementor Pro
    • Ecommerce
      • Retail clothing websites
    • SEO Reading
    • SEO Content Writing
    • Social Media
    • Website Hosting
  • Blog
  • Shop
    • Domain Names
    • UK Web Hosting
  • Contact
    • Website Design Questionnaire

Woocommerce Elementor order by stock quantity

Woocommerce Elementor Pro Product Sort Widget

Using Woocommerce Elementor Pro order by stock quantity solution. Also help with general sorting problems.

There is no sort by widget in elementor pro?

woocommerce elementor products-sort by dropdown

We need to sort our products! Our customers need to be able to see the most expensive or cheapest products. Here is what we did to solve the problem.

In your child theme functions.php add.

// Creating Shortcode for Product Sorting
add_shortcode('wc_sorting','woocommerce_catalog_ordering');

Drag the Shortcode widget onto the elementor pro page builder and type [wc_sorting]
The sort by drop-down will appear to your customers.

If you don’t have a child theme read this https://elementor.com/blog/wordpress-child-theme/

Remove the Reviews from the dropdown

We have not enabled reviews on our products, so there are no reviews to be sorted by.

// Edit WooCommerce dropdown menu item of shop page//
// Options: menu_order, popularity, rating, date, price, price-desc
 
function my_woocommerce_catalog_orderby( $orderby ) {
    unset($orderby["rating"]);
    return $orderby;
}
add_filter( "woocommerce_catalog_orderby", "my_woocommerce_catalog_orderby", 20 );

Woocomerce Order by Stock Values

Some clients need large volumes of our products.  Endless scrolling is not helping the customer experience.

We did install some of the popular sorting plugins but for some reason, they sorted stock alphabetically. 1,100,2,300 This doesn’t help our customers at all.

https://stackoverflow.com/questions/62353002/add-sorting-by-stock-quantity-in-woocommerce-products-sort-by

// Ordering products based on the stock quantity values
function filter_woocommerce_get_catalog_ordering_args( $args, $orderby, $order ) {    
    switch( $orderby ) {
        case 'availability':
            $args['orderby']  = 'meta_value_num';
            $args['order']    = 'DESC';
            $args['meta_key'] = '_stock';
            break;
    }

    return $args;
}
add_filter( 'woocommerce_get_catalog_ordering_args', 'filter_woocommerce_get_catalog_ordering_args', 10, 3 );

// Orderby setting
function filter_orderby( $orderby ) {
    $orderby['availability'] = __( 'Availability', 'woocommerce' );
    return $orderby;
}
add_filter( 'woocommerce_default_catalog_orderby_options', 'filter_orderby', 10, 1 );
add_filter( 'woocommerce_catalog_orderby', 'filter_orderby', 10, 1 );

WooCommerce – Sorting problem sorted

When we first added the changes above, we were so happy! Then we realised the results were not in the correct order “What a pain!”. Don’t worry, there is a solution…

WooCommerce > Status > Tools > Product lookup tables – Click Regenerate

woocommerce sorting error

https://stackoverflow.com/questions/47056744/woocommerce-order-by-price-not-working-correctly

More help with woocommerce sorting options

Woocommerce sorting options are pretty well hidden.
Appearance > Customize > WooCommerce > Product Catalogue
 
help-with-woocommerce-sorting
 
I hope this post saves you a lot of time. Please share it. Please also comment and suggest improvements.

Share this:

  • Print
  • Facebook
  • LinkedIn
  • Twitter
  • Pocket
  • Reddit
  • Pinterest
Pete

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Woocommerce Elementor order by stock quantity
  • Saving the environment with used office chairs (Oct 22)
  • Revalyu Launch
  • Woocommerce get variation meta data PHP
  • Responsive brochure style website. SEO by Artofdata

Recent Comments

    Archives

    • December 2022
    • October 2022
    • May 2022
    • July 2021
    • February 2021
    • January 2021
    • September 2020
    • August 2020
    • April 2020
    • June 2019
    • April 2019
    • March 2019
    • February 2019
    • January 2019

    Categories

    • Brochure Websites (2)
    • Ecommerce (5)
    • Logo (1)
    • Reading (2)
    • Retail Ecommerce (2)
    • Search Engine Optimisation (2)
    • website content writer (1)
    • Website Design (8)
    • Website design agency (1)
    • Wordpress (1)
    website design agency Reading
    Tel: 01189 420101
    Company Number: 6092965
     
    Copyright © 2023 Artofdata.com Ltd
    Web Design Company Based In Reading.
    • Web Design Reading
    • Contact ArtofData
    • Web Design Company
    • Terms & Conditions
    • Privacy Policy
    Menu
    • Web Design Reading
    • Contact ArtofData
    • Web Design Company
    • Terms & Conditions
    • Privacy Policy

    Artofdata.com Ltd
    (Web Design Agency)
    47 Brooksby Road,
    Reading,
    Berkshire,
    RG31 6LZ

    Facebook
    Twitter
    Youtube
    Pinterest
    Google-drive
    Instagram
    Linkedin
    Reddit
    Map-marker-alt
    Link
    Rss
    Arrow-alt-circle-up
    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
    Cookie SettingsAccept All
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    CookieDurationDescription
    cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
    cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
    cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
    cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
    cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
    viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    SAVE & ACCEPT
    ×
    ×

    Basket