$product->
setDisplayFromPrice($displayFromPrice);
} } private function calculatePriceGroupDiscounts(ListProduct
$product, PriceRule
$price, ShopContextInterface
$context): PriceRule
{ if (!
$product->
isPriceGroupActive()) { return $price;
} $discount =
$this->
getHighestQuantityDiscount($product,
$context,
$price->
getFrom());
if (!
$discount instanceof PriceDiscount
) { return $price;
} $price->
setPrice($price->
getPrice() / 100 *
(100 -
$discount->
getPercent()));
return $price;
} /**
* Returns the highest price group discount for the provided product.
*
* The price groups are stored in the provided context object.
* If the product has no configured price group or the price group has no discount defined for the
* current customer group, the function returns null.
*/