7
7
namespace Magento \Catalog \Block \Product ;
8
8
9
9
use Magento \Catalog \Api \CategoryRepositoryInterface ;
10
- use Magento \Catalog \Block \Product \Context ;
11
10
use Magento \Catalog \Block \Product \ProductList \Toolbar ;
12
11
use Magento \Catalog \Model \Category ;
12
+ use Magento \Catalog \Model \Layer ;
13
13
use Magento \Catalog \Model \Layer \Resolver ;
14
14
use Magento \Catalog \Model \Product ;
15
15
use Magento \Catalog \Model \ResourceModel \Product \Collection ;
16
+ use Magento \Catalog \Pricing \Price \FinalPrice ;
16
17
use Magento \Eav \Model \Entity \Collection \AbstractCollection ;
18
+ use Magento \Framework \App \ActionInterface ;
17
19
use Magento \Framework \Data \Helper \PostHelper ;
18
20
use Magento \Framework \DataObject \IdentityInterface ;
19
21
use Magento \Framework \Exception \NoSuchEntityException ;
22
+ use Magento \Framework \Pricing \Render ;
20
23
use Magento \Framework \Url \Helper \Data ;
21
24
22
25
/**
@@ -64,11 +67,11 @@ class ListProduct extends AbstractProduct implements IdentityInterface
64
67
protected $ categoryRepository ;
65
68
66
69
/**
67
- * @param \Magento\Catalog\Block\Product\ Context $context
68
- * @param \Magento\Framework\Data\Helper\ PostHelper $postDataHelper
69
- * @param \Magento\Catalog\Model\Layer\ Resolver $layerResolver
70
- * @param \Magento\Catalog\Api\ CategoryRepositoryInterface $categoryRepository
71
- * @param \Magento\Framework\Url\Helper\ Data $urlHelper
70
+ * @param Context $context
71
+ * @param PostHelper $postDataHelper
72
+ * @param Resolver $layerResolver
73
+ * @param CategoryRepositoryInterface $categoryRepository
74
+ * @param Data $urlHelper
72
75
* @param array $data
73
76
*/
74
77
public function __construct (
@@ -117,7 +120,7 @@ protected function _getProductCollection()
117
120
/**
118
121
* Get catalog layer model
119
122
*
120
- * @return \Magento\Catalog\Model\ Layer
123
+ * @return Layer
121
124
*/
122
125
public function getLayer ()
123
126
{
@@ -191,7 +194,7 @@ protected function _beforeToHtml()
191
194
/**
192
195
* Add toolbar block from product listing layout
193
196
*
194
- * @param \Magento\Catalog\Model\ResourceModel\Product\ Collection $collection
197
+ * @param Collection $collection
195
198
*/
196
199
private function addToolbarBlock (Collection $ collection )
197
200
{
@@ -267,7 +270,7 @@ public function setCollection($collection)
267
270
}
268
271
269
272
/**
270
- * @param array|string|integer|\Magento\Framework\App\Config\ Element $code
273
+ * @param array|string|integer|Element $code
271
274
* @return $this
272
275
*/
273
276
public function addAttribute ($ code )
@@ -287,7 +290,7 @@ public function getPriceBlockTemplate()
287
290
/**
288
291
* Retrieve Catalog Config object
289
292
*
290
- * @return \Magento\Catalog\Model\ Config
293
+ * @return Config
291
294
*/
292
295
protected function _getConfig ()
293
296
{
@@ -297,10 +300,10 @@ protected function _getConfig()
297
300
/**
298
301
* Prepare Sort By fields from Category Data
299
302
*
300
- * @param \Magento\Catalog\Model\ Category $category
301
- * @return \Magento\Catalog\Block\Product\ListProduct
303
+ * @param Category $category
304
+ * @return $this
302
305
*/
303
- public function prepareSortableFieldsByCategory ($ category )
306
+ public function prepareSortableFieldsByCategory (Category $ category )
304
307
{
305
308
if (!$ this ->getAvailableOrders ()) {
306
309
$ this ->setAvailableOrders ($ category ->getAvailableSortByOptions ());
@@ -342,38 +345,38 @@ public function getIdentities()
342
345
/**
343
346
* Get post parameters
344
347
*
345
- * @param \Magento\Catalog\Model\ Product $product
348
+ * @param Product $product
346
349
* @return string
347
350
*/
348
- public function getAddToCartPostParams (\ Magento \ Catalog \ Model \ Product $ product )
351
+ public function getAddToCartPostParams (Product $ product )
349
352
{
350
353
$ url = $ this ->getAddToCartUrl ($ product );
351
354
return [
352
355
'action ' => $ url ,
353
356
'data ' => [
354
357
'product ' => $ product ->getEntityId (),
355
- \ Magento \ Framework \ App \ ActionInterface::PARAM_NAME_URL_ENCODED => $ this ->urlHelper ->getEncodedUrl ($ url ),
358
+ ActionInterface::PARAM_NAME_URL_ENCODED => $ this ->urlHelper ->getEncodedUrl ($ url ),
356
359
]
357
360
];
358
361
}
359
362
360
363
/**
361
- * @param \Magento\Catalog\Model\ Product $product
364
+ * @param Product $product
362
365
* @return string
363
366
*/
364
- public function getProductPrice (\ Magento \ Catalog \ Model \ Product $ product )
367
+ public function getProductPrice (Product $ product )
365
368
{
366
369
$ priceRender = $ this ->getPriceRender ();
367
370
368
371
$ price = '' ;
369
372
if ($ priceRender ) {
370
373
$ price = $ priceRender ->render (
371
- \ Magento \ Catalog \ Pricing \ Price \ FinalPrice::PRICE_CODE ,
374
+ FinalPrice::PRICE_CODE ,
372
375
$ product ,
373
376
[
374
377
'include_container ' => true ,
375
378
'display_minimal_price ' => true ,
376
- 'zone ' => \ Magento \ Framework \ Pricing \ Render::ZONE_ITEM_LIST ,
379
+ 'zone ' => Render::ZONE_ITEM_LIST ,
377
380
'list_category_page ' => true
378
381
]
379
382
);
@@ -386,7 +389,7 @@ public function getProductPrice(\Magento\Catalog\Model\Product $product)
386
389
* Specifies that price rendering should be done for the list of products
387
390
* i.e. rendering happens in the scope of product list, but not single product
388
391
*
389
- * @return \Magento\Framework\Pricing\ Render
392
+ * @return Render
390
393
*/
391
394
protected function getPriceRender ()
392
395
{
0 commit comments