Home Forums WoodMart support forum Show out of Stock Products Last

Show out of Stock Products Last

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #369175

    LiamTGCS
    Participant

    Hi team, is there a way, or can you implement this feature?

    To show out of stock products at the end of the pagination – there is no point showing out of stock products in the middle of in-stock products.

    If you check the screenshot, you can see here that two out of stock products show in the middle of in-stock products. I think it is best to prioritize in-stock products rather than out of stock items.

    Can this be a feature implemented if it doesn’t already exist in WoodMart for WooCommerce?

    Attachments:
    You must be logged in to view attached files.
    #369330

    Hello,

    Sorry but there is no option in Theme Settings available for that.

    For now and I am forwarding this to our development department for considering to add it in the theme,
    but I am not giving you the guarantee for that because please note that a theme cannot satisfy all requirements as it may cause theme heaviness.
    Sometimes it may require your own customization. So if the development department finds it fit with the theme environment then surely they will look through it.

    Best Regards

    #372394

    LiamTGCS
    Participant

    Hi, just following up to see if there was any feedback from the development department, as this would definitely be a very useful feature, and will allow for a cleaner experience.

    Alternatively, can you help with clean code I can add to the functions.php file in Child theme to show out of stock products last? I have some code, but it is not messy, and it doesn’t follow proper WooCommerce product positions (It simply filters by ASC).

    add_filter( 'woocommerce_get_catalog_ordering_args', 'woo_sort_by_stock', 9999 );
     
    function woo_sort_by_stock( $args ) {
       $args['orderby'] = 'meta_value';
       $args['order'] = 'ASC';
       $args['meta_key'] = '_stock_status';
       return $args;
    }
    • This reply was modified 2 years, 10 months ago by LiamTGCS.
    #372421

    Hello,

    Sorry but we don’t have a working solution to this. Such customization is out of our theme support scope

    Best Regards.

    #449045

    giantpanos
    Participant

    @LiamTGCS, have you found a solution for this?

    I want to show out of stock products last as there is no point showing them earlier.

    Thanks!

    #449553

    Hello,


    @giantpanos
    : We would suggest you to try contacting WooCommerce Support in this regard until @LiamTGCS responds because as you know the Archive pages come from WooCommerce by default and WooCommerce itself doesn’t allow such change. So, if you want to go with the Code Snippet change then they are the best ones to help you out with. Hope you can understand !

    Best Regards.

Viewing 6 posts - 1 through 6 (of 6 total)