From 633848a8b4738db8d5086bc66945642e93d5d957 Mon Sep 17 00:00:00 2001 From: Maxime LECLERCQ Date: Thu, 22 Feb 2018 11:55:43 +0100 Subject: [PATCH] Fixing offer price value --- Model/Product/Indexer/Fulltext/Datasource/OfferData.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Model/Product/Indexer/Fulltext/Datasource/OfferData.php b/Model/Product/Indexer/Fulltext/Datasource/OfferData.php index 84d9ffe..18ef68e 100644 --- a/Model/Product/Indexer/Fulltext/Datasource/OfferData.php +++ b/Model/Product/Indexer/Fulltext/Datasource/OfferData.php @@ -70,8 +70,6 @@ public function addData($storeId, array $indexData) /** * Process offer prices * - * @SuppressWarnings(PHPMD.ElseExpression) - * * @param array $offerData Offer Data * @param array $productData Product Data * @@ -84,17 +82,16 @@ private function processOfferPrices($offerData, $productData) foreach ($productData['price'] as $currentPriceData) { if ($currentPriceData['customer_group_id'] == CustomerGroupInterface::NOT_LOGGED_IN_ID) { $defaultPriceData = $currentPriceData; + break; } } $offerData = array_filter($offerData); $offerData['original_price'] = isset($offerData['price']) ? $offerData['price'] : $defaultPriceData['original_price']; - + $offerData['price'] = $offerData['original_price']; if (isset($offerData['special_price'])) { $offerData['price'] = min($offerData['price'], $offerData['special_price']); unset($offerData['special_price']); - } else { - $offerData['price'] = $defaultPriceData['price']; } $offerData['is_discount'] = $offerData['price'] < $offerData['original_price'];