magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Catalog New Products List widget not sorting according to 'created_at' #18090

Closed BezV8 closed 6 years ago

BezV8 commented 6 years ago

The Catalog New Products List widget in Magneto 2 does not appear to be sorting products by their created date. Instead it seems to be selecting products according to the updated date, but no sorting them as such. The function _getRecentlyAddedProductsCollection() in file vendor/magento/module-catalog/Block/Product/Widget/NewWidget.php should sort by 'created_at', 'desc', but does not do so.

Preconditions

  1. Magento 2.2.1
  2. Product catalog with a range of 'created_at' and 'update_at' values.
  3. New product widget set to all products.

Steps to reproduce

  1. Add new product widget to page.
  2. Check sort order of products against 'created_at' values in database.

Expected result

  1. Products should be sorted by ->addAttributeToSort('created_at', 'desc').

Actual result

  1. Products appear to be being selected according to 'update_at' and are not sorted by either attribute.
magento-engcom-team commented 6 years ago

Hi @BezV8. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop). For more details, please, review the Magento Contributor Assistant documentation.

@BezV8 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

magento-engcom-team commented 6 years ago

Hi @engcom-backlog-nazar. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

ghost commented 6 years ago

Hi @BezV8 thank you for you report, the fix for this issue has already available in 2.3-develop branch

BezV8 commented 6 years ago

@engcom-backlog-nazar Thanks for the quick response, sorry I missed the previous ticket. Would you be able to tell me what file was modified for the fix? The issue is effecting one of our clients and I could make a module to temporarily fix until the new patch.

ghost commented 6 years ago

Hi @BezV8 No, i'm searching but cant find commit. But works perfectly on 2.*-dev branches