Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Variables
listing.phtml File Reference

Go to the source code of this file.

Variables

 $start = microtime(true)
 
 $_productCollection = $block->getLoadedProductCollection()
 
 $_helper = $this->helper('Magento\Catalog\Helper\Output')
 
if(! $_productCollection->count())( 'We can\ 't find products matching the selection.') ?></p ><?php else() ?><? if($block->getMode()=='grid') else
 
 $image = 'category_page_list'
 
 $showDescription = true
 
 $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::FULL_VIEW
 
foreach( $_productCollection as $_product)() ?>" class $info = []
 
 $info ['name']
 
 $info ['price'] = $block->getProductPrice($_product)
 
 $info ['review'] = $block->getReviewsSummaryHtml($_product, $templateType)
 
 $info ['links']
 
 $info ['actions'] = '<div class="product action">' . $info['button'] . $info['links'] . '</div>'
 
 $details = $block->getInfoOrder() ?: ['name','price','review','description','actions']
 
foreach($details as $detail) endforeach
 
 endif = $block->getToolbarHtml()
 

Variable Documentation

◆ $_helper

$_helper = $this->helper('Magento\Catalog\Helper\Output')

Definition at line 20 of file listing.phtml.

◆ $_productCollection

$_productCollection = $block->getLoadedProductCollection()

Definition at line 19 of file listing.phtml.

◆ $details

$details = $block->getInfoOrder() ?: ['name','price','review','description','actions']

Definition at line 86 of file listing.phtml.

◆ $image

$image = 'category_page_list'

Definition at line 35 of file listing.phtml.

◆ $info [1/6]

foreach ($_productCollection as $_product) () ?>" class $info = []

Definition at line 52 of file listing.phtml.

◆ $info [2/6]

$info[ 'name']
Initial value:
= '<strong class="product name">'
. ' <a href="' . $_product->getProductUrl() . '" title="'
. $block->stripTags($_product->getName(), null, true) . '">'
. $_helper->productAttribute($_product, $_product->getName(), 'name')
. '</a></strong>'
$_product
Definition: summary.phtml:12
$block
Definition: block.php:8
$_helper
Definition: listing.phtml:20

Definition at line 53 of file listing.phtml.

◆ $info [3/6]

$info[ 'price'] = $block->getProductPrice($_product)

Definition at line 58 of file listing.phtml.

◆ $info [4/6]

$info[ 'review'] = $block->getReviewsSummaryHtml($_product, $templateType)

Definition at line 59 of file listing.phtml.

◆ $info [5/6]

$info[ 'links']
Initial value:
= '<div class="product links" data-role="add-to-links">'
. '<a href="#" data-post=\'' . $this->helper('Magento\Wishlist\Helper\Data')->getAddParams($_product) . '\' class="action towishlist" data-action="add-to-wishlist">'
. '<span>' . __('Add to Wish List') . '</span></a>'
. '<a href="' . $block->getAddToCompareUrl($_product) . '" class="action tocompare">'
. '<span>' . __('Add to Compare') . '</span></a></div>'
$_product
Definition: summary.phtml:12

Definition at line 70 of file listing.phtml.

◆ $info [6/6]

$info[ 'actions'] = '<div class="product action">' . $info['button'] . $info['links'] . '</div>'

Definition at line 75 of file listing.phtml.

◆ $showDescription

$showDescription = true

Definition at line 36 of file listing.phtml.

◆ $start

$start = microtime(true)

Copyright © Magento, Inc. All rights reserved. See COPYING.txt for license details.Product list template

See also
\Magento\Catalog\Block\Product\ListProduct

Definition at line 18 of file listing.phtml.

◆ $templateType

Definition at line 37 of file listing.phtml.

◆ else

if ( $showDescription) else
Initial value:
{
$viewMode = 'list'

Definition at line 33 of file listing.phtml.

◆ endforeach

foreach ( $details as $detail) endforeach

Definition at line 87 of file listing.phtml.

◆ endif

endif = $block->getToolbarHtml()

Definition at line 98 of file listing.phtml.