• Resolved kotromar

    (@kotromar)


    Hello,

    I am trying to find a solution to sort products by publication date and also products that are out of stock at the end. I have tested many codes but none work as expected.

    Is it possible to have the products that are not in stock also show up at the end in case of a search.

    Thank you very much in advance.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi,

    I was checking this thread: Sort products by last edited date in admin? And it is working on my backend, you can add the code directly to your functions.php file or using the Code Snippets. It looks like a good first step. You will need to adapt that code to show the out-of-stock products last.

    Please note, I’m not a developer, however, this thread will keep open for a while so that anyone else can provide a solution if possible.

    I hope this points you in the right direction.

    Thread Starter kotromar

    (@kotromar)

    Hi,

    thank you for your response. I’m mainly concerned with the products on the frontend. The client has more than 15,000 products on the site and in this amount, product ordering is important for easy orientation.

    Therefore, I am looking for a solution to display the products that are out of stock at the end and at the same time the products that are in stock to display according to the latest modifications.

    Thank you
    Marek

    Hi,

    I can understand your point, that makes sense. You can find more information from these web articles:

    Hope this helps.

    Thread Starter kotromar

    (@kotromar)

    Hey. Hey,

    thank you so much for the links. I tried, but these rules don’t work when applied together.

    Hi there @kotromar

    As I understand, sorting products by last modified date works as expected, when implemented alone. Correct?

    Could you elaborate further on the customer workflow in regard to out-of-stock items, as that would enable us to have a better overview, please?

    Having them appear at the bottom of the list, when sorting >15K products, is quite similar to opting for not displaying out-of-stock items at all in the first place.

    Looking forward to your response, thank you.

    Thread Starter kotromar

    (@kotromar)

    Hi,

    the client needs all items visible as the store is only for wholesale customers. For products that are out of stock, it is possible to add your email to the waiting list and the manufacturer can adjust the priority of the products accordingly.

    At the same time, the products need to be sorted by modification date because the modification date changes automatically when synchronizing products that are back in stock. Products that are back in stock receive a “new” label.

    You can check the client’s website rutkovsky.com

    Looking forward to your response, thank you.

    Hi,
    You can do that through the Advanced Post Types Order plugin and a custom code, see this article for more details.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi @kotromar! Would you mind letting us know if the suggestion shared by @tdgu worked for you?

    Cheers!

    Thread Starter kotromar

    (@kotromar)

    Hi @gabrielfuentes,

    I’ve tried all the ways, but the combination of all the rules never worked together. The current situation is that the default sorting works as it should. Products sort from newest and those out of stock at the end. however, it doesn’t work with search results.

    Hi @kotromar

    The current situation is that the default sorting works as it should. Products sort from newest and those out of stock at the end. however, it doesn’t work with search results.

    Thanks for your confirmation here that these codes work when sorting, however, does not work with search results.

    You might want to try the links below as your inquiry might require customization to do it. For questions related to development and custom coding, your best bet is to ask on any of these channels for support. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, too.

    Hope this helps!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Sort products by publication date and products that are out of stock show at the’ is closed to new replies.