I pass to catalogs list.phtml a custom product collection as
public function getCurrentProduct()
{
return $this->_coreRegistry->registry('current_product');
}
public function _getProductCollection()
{
$product = $this->getCurrentProduct();
if ($product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE) {
$variants = $this->getProduct()->getTypeInstance()->getUsedProductIds($product);
$collection = $this->_productsFactory->create();
$collection->addIdFilter($variants);
return $collection;
}
return null;
}
but on output I do not have price and product name. Can somebody help with this issue?