1

I need to display correct prices of configurable products in category page. It should be by default, but Magento takes into account out of stock simple products prices. Therefore configurable product lowest price is displayed incorrectly ("as low as" price).

For instance, there is configurable product which costs 44.95 and has a variation which cost 39.95, but is "out of stock". Configurable product should be 44.95 without extra "as low as 39.95"


enter image description here


enter image description here


I've tryed this answer how magento getting configurable product lowest price of associated products? by changing line $price = $price ? max($price, $productPrice) : $productPrice; to $price = $price ? min($price, $productPrice) : $productPrice; (max to min), but didn't work.

I've also tryed overwriting \Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver simply changing

foreach ($this->lowestPriceOptionsProvider->getProducts($product) as $subProduct) {
            $productPrice = $this->priceResolver->resolvePrice($subProduct);
            $price = $price ? min($price, $productPrice) : $productPrice;
        }

to

foreach ($this->lowestPriceOptionsProvider->getProducts($product) as $subProduct) {
         if ($subProduct->isSaleable()) {
            $productPrice = $this->priceResolver->resolvePrice($subProduct);
            $price = $price ? min($price, $productPrice) : $productPrice;
         }
        }

no luck though. Came up to disable showing "as low as". Any suggestions?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.