getMinProduct()->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue(); } /** * Returns product with minimal price * * @return Product */ public function getMinProduct() { if (null === $this->minProduct) { $products = $this->product->getTypeInstance()->getAssociatedProducts($this->product); $minPrice = null; foreach ($products as $item) { $product = clone $item; $product->setQty(\Magento\Framework\Pricing\PriceInfoInterface::PRODUCT_QUANTITY_DEFAULT); $price = $product->getPriceInfo() ->getPrice(FinalPrice::PRICE_CODE) ->getValue(); if (($price !== false) && ($price <= ($minPrice === null ? $price : $minPrice))) { $this->minProduct = $product; $minPrice = $price; } } } return $this->minProduct; } }