@@ -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
- const DEFAULT_PRODUCTS_COUNT = 10 ;
46
+ public 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
- const PAGE_VAR_NAME = 'np ' ;
53
+ public const PAGE_VAR_NAME = 'np ' ;
54
54
55
55
/**
56
56
* Default value for products per page
57
57
*/
58
- const DEFAULT_PRODUCTS_PER_PAGE = 5 ;
58
+ public const DEFAULT_PRODUCTS_PER_PAGE = 5 ;
59
59
60
60
/**
61
61
* Default value whether show pager or not
62
62
*/
63
- const DEFAULT_SHOW_PAGER = false ;
63
+ public const DEFAULT_SHOW_PAGER = false ;
64
64
65
65
/**
66
66
* Instance of pager block
@@ -75,15 +75,11 @@ class ProductsList extends AbstractProduct implements BlockInterface, IdentityIn
75
75
protected $ httpContext ;
76
76
77
77
/**
78
- * Catalog product visibility
79
- *
80
78
* @var Visibility
81
79
*/
82
80
protected $ catalogProductVisibility ;
83
81
84
82
/**
85
- * Product collection factory
86
- *
87
83
* @var CollectionFactory
88
84
*/
89
85
protected $ productCollectionFactory ;
@@ -338,12 +334,12 @@ public function createCollection()
338
334
$ collection ->setVisibility ($ this ->catalogProductVisibility ->getVisibleInCatalogIds ());
339
335
340
336
/**
341
- * Change sorting attribute to entity_id because created_at can be the same for products fastly created
337
+ * Change sorting attribute to position because created_at can be the same for products fastly created
342
338
* one by one and sorting by created_at is indeterministic in this case.
343
339
*/
344
340
$ collection = $ this ->_addProductAttributesAndPrices ($ collection )
345
341
->addStoreFilter ()
346
- ->addAttributeToSort ('entity_id ' , 'desc ' )
342
+ ->addAttributeToSort ('position ' , 'asc ' )
347
343
->setPageSize ($ this ->getPageSize ())
348
344
->setCurPage ($ this ->getRequest ()->getParam ($ this ->getData ('page_var_name ' ), 1 ));
349
345
0 commit comments