@@ -43,24 +43,24 @@ class ProductsList extends AbstractProduct implements BlockInterface, IdentityIn
43
43
/**
44
44
* Default value for products count that will be shown
45
45
*/
46
- public const DEFAULT_PRODUCTS_COUNT = 10 ;
46
+ const DEFAULT_PRODUCTS_COUNT = 10 ;
47
47
48
48
/**
49
49
* Name of request parameter for page number value
50
50
*
51
51
* @deprecated @see $this->getData('page_var_name')
52
52
*/
53
- public const PAGE_VAR_NAME = 'np ' ;
53
+ const PAGE_VAR_NAME = 'np ' ;
54
54
55
55
/**
56
56
* Default value for products per page
57
57
*/
58
- public const DEFAULT_PRODUCTS_PER_PAGE = 5 ;
58
+ const DEFAULT_PRODUCTS_PER_PAGE = 5 ;
59
59
60
60
/**
61
61
* Default value whether show pager or not
62
62
*/
63
- public const DEFAULT_SHOW_PAGER = false ;
63
+ const DEFAULT_SHOW_PAGER = false ;
64
64
65
65
/**
66
66
* Instance of pager block
@@ -75,11 +75,15 @@ class ProductsList extends AbstractProduct implements BlockInterface, IdentityIn
75
75
protected $ httpContext ;
76
76
77
77
/**
78
+ * Catalog product visibility
79
+ *
78
80
* @var Visibility
79
81
*/
80
82
protected $ catalogProductVisibility ;
81
83
82
84
/**
85
+ * Product collection factory
86
+ *
83
87
* @var CollectionFactory
84
88
*/
85
89
protected $ productCollectionFactory ;
@@ -235,8 +239,8 @@ public function getCacheKeyInfo()
235
239
*/
236
240
public function getProductPriceHtml (
237
241
Product $ product ,
238
- $ priceType = null ,
239
- $ renderZone = \Magento \Framework \Pricing \Render::ZONE_ITEM_LIST ,
242
+ $ priceType = null ,
243
+ $ renderZone = \Magento \Framework \Pricing \Render::ZONE_ITEM_LIST ,
240
244
array $ arguments = []
241
245
) {
242
246
if (!isset ($ arguments ['zone ' ])) {
@@ -334,12 +338,12 @@ public function createCollection()
334
338
$ collection ->setVisibility ($ this ->catalogProductVisibility ->getVisibleInCatalogIds ());
335
339
336
340
/**
337
- * Change sorting attribute to position because created_at can be the same for products fastly created
341
+ * Change sorting attribute to entity_id because created_at can be the same for products fastly created
338
342
* one by one and sorting by created_at is indeterministic in this case.
339
343
*/
340
344
$ collection = $ this ->_addProductAttributesAndPrices ($ collection )
341
345
->addStoreFilter ()
342
- ->addAttributeToSort ('position ' , 'asc ' )
346
+ ->addAttributeToSort ('entity_id ' , 'desc ' )
343
347
->setPageSize ($ this ->getPageSize ())
344
348
->setCurPage ($ this ->getRequest ()->getParam ($ this ->getData ('page_var_name ' ), 1 ));
345
349
0 commit comments