Model/Connector/Product.php
private function getMinPrices($product)
    {
        if ($product->getTypeId() == 'configurable') {
            foreach ($product->getTypeInstance()->getUsedProducts($product) as $childProduct) {
                $childPrices[] = $childProduct->getPrice();
                if ($childProduct->getSpecialPrice() !== null) {
                    $childSpecialPrices[] = $childProduct->getSpecialPrice();
                }
            }
            $this->price = isset($childPrices) ? min($childPrices) : null;
            $this->specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;
        } elseif ($product->getTypeId() == 'bundle') {
            $this->price = $product->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue();
            $this->specialPrice = $product->getPriceInfo()->getPrice('final_price')->getMinimalPrice()->getValue();
            //if special price equals to price then its wrong.)
            $this->specialPrice = ($this->specialPrice === $this->price) ? null : $this->specialPrice;
        } elseif ($product->getTypeId() == 'grouped') {
            foreach ($product->getTypeInstance()->getAssociatedProducts($product) as $childProduct) {
                $childPrices[] = $childProduct->getPrice();
                if ($childProduct->getSpecialPrice() !== null) {
                    $childSpecialPrices[] = $childProduct->getSpecialPrice();
                }
            }
            $this->price = isset($childPrices) ? min($childPrices) : null;
            $this->specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;
        } else {
            $this->price = $product->getPrice();
            $this->specialPrice = $product->getSpecialPrice();
        }
        $this->formatPriceValues();
    }
private function getMinPrices($product)
    {
        if ($product->getTypeId() == 'configurable') {
            foreach ($product->getTypeInstance()->getUsedProducts($product) as $childProduct) {
                $childPrices[] = $childProduct->getPrice();
                if ($childProduct->getSpecialPrice() !== null) {
                    $childSpecialPrices[] = $childProduct->getSpecialPrice();
                }
            }
            $this->price = isset($childPrices) ? min($childPrices) : null;
            $this->specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;
        } elseif ($product->getTypeId() == 'bundle') {
            $this->price = $product->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue();
            $this->specialPrice = $product->getPriceInfo()->getPrice('final_price')->getMinimalPrice()->getValue();
            //if special price equals to price then its wrong.)
            $this->specialPrice = ($this->specialPrice === $this->price) ? null : $this->specialPrice;
        } elseif ($product->getTypeId() == 'grouped') {
            foreach ($product->getTypeInstance()->getAssociatedProducts($product) as $childProduct) {
                $childPrices[] = $childProduct->getPrice();
                if ($childProduct->getSpecialPrice() !== null) {
                    $childSpecialPrices[] = $childProduct->getSpecialPrice();
                }
            }
            $this->price = isset($childPrices) ? min($childPrices) : null;
            $this->specialPrice = isset($childSpecialPrices) ? min($childSpecialPrices) : null;
        } else {
            $this->price = $product->getPrice();
            $this->specialPrice = $product->getSpecialPrice();
        }
        $this->formatPriceValues();
    }
private function getMinPrices ( $ product ) { if ( $ product -> getTypeId ( ) == 'configurable' ) { foreach ( $ product -> getTypeInstance ( ) -> getUsedProducts ( $ product ) as $ childProduct ) { $ childPrices [ ] = $ childProduct -> getPrice ( ) ; if ( $ childProduct -> getSpecialPrice ( ) !== null ) { $ childSpecialPrices [ ] = $ childProduct -> getSpecialPrice ( ) ; } } $ this -> price = isset ( $ childPrices ) ? min ( $ childPrices ) : null ; $ this -> specialPrice = isset ( $ childSpecialPrices ) ? min ( $ childSpecialPrices ) : null ; } elseif ( $ product -> getTypeId ( ) == 'bundle' ) { $ this -> price = $ product -> getPriceInfo ( ) -> getPrice ( 'regular_price' ) -> getMinimalPrice ( ) -> getValue ( ) ; $ this -> specialPrice = $ product -> getPriceInfo ( ) -> getPrice ( 'final_price' ) -> getMinimalPrice ( ) -> getValue ( ) ; //if special price equals to price then its wrong.) $ this -> specialPrice = ( $ this -> specialPrice === $ this -> price ) ? null : $ this -> specialPrice ; } elseif ( $ product -> getTypeId ( ) == 'grouped' ) { foreach ( $ product -> getTypeInstance ( ) -> getAssociatedProducts ( $ product ) as $ childProduct ) { $ childPrices [ ] = $ childProduct -> getPrice ( ) ; if ( $ childProduct -> getSpecialPrice ( ) !== null ) { $ childSpecialPrices [ ] = $ childProduct -> getSpecialPrice ( ) ; } } $ this -> price = isset ( $ childPrices ) ? min ( $ childPrices ) : null ; $ this -> specialPrice = isset ( $ childSpecialPrices ) ? min ( $ childSpecialPrices ) : null ; } else { $ this -> price = $ product -> getPrice ( ) ; $ this -> specialPrice = $ product -> getSpecialPrice ( ) ; } $ this -> formatPriceValues ( ) ; }
Set the Minimum Prices for Configurable and Bundle products.

@param \Magento\Catalog\Model\Product $product

@return null
Set the Minimum Prices for Configurable and Bundle products .