I am trying to override ConfigurablePriceResolver but can't override
app/code/vender/module/etc/di.xml
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver" type="Vender\Module\Pricing\Price\ConfigurablePriceResolver" />
</config>
app\code\Vender\module\Pricing\Price\ConfigurablePriceResolver.php
<?php
namespace Vender\Module\Pricing\Price;
class ConfigurablePriceResolver extends \Magento\ConfigurableProduct\Pricing\Price\ConfigurablePriceResolver
{
/**
* @param \Magento\Framework\Pricing\SaleableInterface|\Magento\Catalog\Model\Product $product
* @return float
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function ResolvePrice(\Magento\Framework\Pricing\SaleableInterface $product) {
$price = null;
foreach ($this->configurable->getUsedProducts($product) as $subProduct) {
$productPrice = $this->priceResolver->resolvePrice($subProduct);
$price = $price ? min($price, $productPrice) : $productPrice;
}
/* if (!$price) {
throw new \Magento\Framework\Exception\LocalizedException(
__('Configurable product "%1" do not have sub-products', $product->getName())
);
} */
return $price === null ? null : (float)$price;
}
}