get thumbnail image in product collection magento 2.3 but base image get how to get thumbnail image
phtml file
<?php
$ProductImageUrl = $block->getUrl('pub/media/catalog').'product'.$product->getImage();
?>
<a class="productlinks" href="" title=""><img src="<?php echo $ProductImageUrl; ?>" width="210" height="210">
</a>
Block File
protected $_productCollectionFactory;
public function __construct(
\Magento\Catalog\Block\Product\Context $context,
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
array $data = []
)
{
$this->_productCollectionFactory = $productCollectionFactory;
parent::__construct($context, $data);
}
public function getProductCollection()
{
$porIds=array(1,2,3);
$collection = $this->_productCollectionFactory->create();
$collection->addAttributeToSelect('*');
$collection->addFieldToFilter('entity_id', array('in' => $porIds));
return $collection;
}