How could I change search result from ascending to descending product ID order?

Created by Support Agent, Modified on Wed, 8 Apr at 10:55 AM by Support Agent


Question:

I notice when searching from the Fast Order extension, it sorts by ID # and in ascending order, so the very first product ever entered will be the first to show in the list.

Is it possible to simply change that to descending order, so the latest products appear first within the search results?


Answer:

You could edit this file: app/code/Bss/FastOrder/Model/Search/Save.php


line 173

return $collection;


to

return $collection->addAttributeToSort('entity_id', 'desc');

 

For more information about product, please refer Magento 2 Wholesale Fast Order page.


If you need any further assistance, please feel free to contact us. We'd like to help. Don't forget that we are a trusted Magento 2 extensions provider with 14+ years of experience, serving 75,000+ customers worldwide. We are an Adobe Commerce Solution Bronze Partner and a Select Magento Extensions Builder, reinforcing our expertise in the Magento ecosystem.


BSS Commerce specialize in developing 150+ high-quality Magento 2 extensions that enhance functionality, improve user experience, and support scalable growth. Our reputation is built on long-term partnerships, positive feedback, and proven performance-driven solutions.


Looking for more at https://bsscommerce.com/magento-2-extensions.html 


Here are some extensions that your store might need:

  • BSS Commerce’s Magento 2 B2B Extension helps you close more wholesale deals with efficient ordering and customized pricing.
  • BSS Commerce’s Magento 2 SEO Extension attracts more customers and increases conversions with optimized search performance.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article