<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/* @var $block \Magento\Catalog\Block\Product\AbstractProduct */
?>

<?php
$items = $block->getItems();
 if ($exist =  $items->getSize()) {
	
            $type = 'crosssell';
            $class = $type;
            $image = 'cart_cross_sell_products';
            $title = __('Crosssell Products');
            $items = $block->getItems();

            $showAddTo = true;
            $showCart = true;
            $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
            $description = false;
            $canItemsAddToCart = false;
        }

?>

<?php if ($exist):?>    
 <div class="block <?php /* @escapeNotVerified */ echo $class; ?>">
    <div class="block-title title">
        <strong id="block-<?php /* @escapeNotVerified */ echo $class?>-heading" role="heading" aria-level="2"><?php /* @escapeNotVerified */ echo $title; ?></strong>
    </div>
    <div class="block-content content" aria-labelledby="block-<?php /* @escapeNotVerified */ echo $class?>-heading">
      
        <div class="products wrapper grid products-grid products-<?php /* @escapeNotVerified */ echo $type; ?>">
            <ol class="products list items product-items">
                <?php $iterator = 1; ?>
                <?php foreach ($items as $_item): ?>
                <?php $available = ''; ?>      
              
                    <?php /* @escapeNotVerified */ echo($iterator++ == 1) ? '<li class="item product product-item">' : '</li><li class="item product product-item">' ?>
               
                <div class="product-item-info <?php /* @escapeNotVerified */ echo $available; ?>">
                    <?php /* @escapeNotVerified */ echo '<!-- ' . $image . '-->' ?>
                    <a href="<?php /* @escapeNotVerified */ echo $block->getProductUrl($_item) ?>" class="product photo product-item-photo">
                        <?php echo $block->getImage($_item, $image)->toHtml(); ?>
                    </a>
                    <div class="product details product-item-details">
                        <strong class="product name product-item-name"><a class="product-item-link" title="<?php echo $block->escapeHtml($_item->getName()) ?>" href="<?php /* @escapeNotVerified */ echo $block->getProductUrl($_item) ?>">
                            <?php echo $block->escapeHtml($_item->getName()) ?></a>
                        </strong>

                        <?php /* @escapeNotVerified */ echo $block->getProductPrice($_item); ?>

                            <?php if ($templateType): ?>
                                <?php echo $block->getReviewsSummaryHtml($_item, $templateType) ?>
                            <?php endif; ?>   
                           
                        </div>
                    </div>
                    <?php echo($iterator == count($items)+1) ? '</li>' : '' ?>
                <?php endforeach ?>
            </ol>
        </div>
    </div>
    </div>

<?php endif;?>
