How can I change the sort order of the product list widget to random()? I am talking about the Product list widget you can insert on CMS pages.

Thank you.


This widget don't have sort functionality. You need create plugin.

You can find how on another topic:

Magento 2 - catalog product list widget product order

| improve this answer | |
  • yes I know I need to write some code, but I can not understand how to do. \Magento\CatalogWidget\Block\Product\ProductsList::createCollection seems like a good start. How can I there add so it is sort by random? (I know I should never edit to M2 source) – M2Newbie Nov 5 '18 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.