Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
result.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php
14 ?>
15 <?php if ($results = $block->getResultCount()): ?>
16  <div class="search found">
17  <?php if ($results == 1) : ?>
18  <?= /* @escapeNotVerified */ __('<strong>%1 item</strong> were found using the following search criteria', $results) ?>
19  <?php else: ?>
20  <?= /* @escapeNotVerified */ __('<strong>%1 items</strong> were found using the following search criteria', $results) ?>
21  <?php endif; ?>
22  </div>
23 <?php else: ?>
24  <div role="alert" class="message error">
25  <div>
26  <?= /* @escapeNotVerified */ __('We can\'t find any items matching these search criteria.') ?> <a href="<?= /* @escapeNotVerified */ $block->getFormUrl() ?>"><?= /* @escapeNotVerified */ __('Modify your search.') ?></a>
27  </div>
28  </div>
29 <?php endif; ?>
30 
31 <?php $searchCriterias = $block->getSearchCriterias(); ?>
32 <div class="search summary">
33  <?php foreach (['left', 'right'] as $side): ?>
34  <?php if (@$searchCriterias[$side]): ?>
35  <ul class="items">
36  <?php foreach ($searchCriterias[$side] as $criteria): ?>
37  <li class="item"><strong><?= $block->escapeHtml(__($criteria['name'])) ?>:</strong> <?= $block->escapeHtml($criteria['value']) ?></li>
38  <?php endforeach; ?>
39  </ul>
40  <?php endif; ?>
41  <?php endforeach; ?>
42 </div>
43 <?php if ($block->getResultCount()): ?>
44  <div class="message notice">
45  <div>
46  <?= /* @escapeNotVerified */ __("Don't see what you're looking for?") ?>
47  <a href="<?= /* @escapeNotVerified */ $block->getFormUrl() ?>"><?= /* @escapeNotVerified */ __('Modify your search.') ?></a>
48  </div>
49  </div>
50 <?php endif; ?>
51 <?php if ($block->getResultCount()): ?>
52  <div class="search results"><?= $block->getProductListHtml() ?></div>
53 <?php endif; ?>
54 <?php $block->getSearchCriterias(); ?>
$results
Definition: popup.phtml:13
__()
Definition: __.php:13
$block
Definition: block.php:8
endforeach
Definition: result.phtml:41
endif
Definition: result.phtml:40
$searchCriterias
Definition: result.phtml:31