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

Created by Chloe Chu, Modified on Tue, 7 May, 2019 at 5:31 PM by Nicole Le


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.

Please visit our site for more useful Magento 2 Extensions: https://bsscommerce.com/magento-2-extensions.html

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