<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php
/**
 * @var $block \Magento\Reports\Block\Product\Viewed
 */
?>
<?php
if ($exist = ($block->getRecentlyViewedProducts() && $block->getRecentlyViewedProducts()->getSize())) {
    $type = 'widget-viewed';

    $image = 'recently_viewed_products_images_only_widget';
    $title = __('Recently Viewed');
    $items = $block->getRecentlyViewedProducts();

    $showWishlist = false;
    $showCompare = false;
    $showCart = false;
    $rating = false;
    $description = false;
}
?>
<?php if ($exist): ?>
    <div class="block widget block-viewed-products-images">
        <div class="block-title">
            <strong><?php /* @escapeNotVerified */ echo $title; ?></strong>
        </div>
        <div class="block-content">
            <?php $suffix = $block->getNameInLayout(); ?>
            <ol id="widget-viewed-<?php /* @escapeNotVerified */ echo $suffix; ?>" class="product-items product-items-images">
                <?php $iterator = 1; ?>
                <?php foreach ($items as $_product): ?>
                    <?php /* @escapeNotVerified */ echo($iterator++ == 1) ? '<li class="product-item">' : '</li><li class="product-item">' ?>
                        <a class="product-item-photo" href="<?php /* @escapeNotVerified */ echo $_product->getProductUrl() ?>" title="<?php /* @escapeNotVerified */ echo $block->stripTags($_product->getName(), null, true) ?>">
                            <?php echo $block->getImage($_product, $image)->toHtml(); ?>
                        </a>
                    <?php echo($iterator == count($items)+1) ? '</li>' : '' ?>
            <?php endforeach; ?>
            </ol>
        </div>
    </div>
<?php endif; ?>
