From f1349461bb483a8702def2f2b0e6254e7e07ecd8 Mon Sep 17 00:00:00 2001 From: Mike Weis Date: Mon, 16 Mar 2015 14:50:09 -0500 Subject: [PATCH 1/2] MAGETWO-35054: Tier price message not shown in product page for some customer groups - fixed --- app/code/Magento/Catalog/Pricing/Price/TierPrice.php | 9 ++++++++- .../view/base/templates/product/price/tier_prices.phtml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Pricing/Price/TierPrice.php b/app/code/Magento/Catalog/Pricing/Price/TierPrice.php index 726d3d05e60f1..34b8239a51321 100644 --- a/app/code/Magento/Catalog/Pricing/Price/TierPrice.php +++ b/app/code/Magento/Catalog/Pricing/Price/TierPrice.php @@ -162,10 +162,17 @@ protected function filterTierPrices(array $priceList) $qtyCache = []; foreach ($priceList as $priceKey => $price) { /* filter price by customer group */ - if ($price['cust_group'] !== $this->customerGroup && $price['cust_group'] !== $this->groupManagement->getAllCustomersGroup()->getId()) { + $eligible = false; + if ($price['cust_group'] == $this->customerGroup) { + $eligible = true; + } elseif ($price['cust_group'] == $this->groupManagement->getAllCustomersGroup()->getId()) { + $eligible = true; + } + if (!$eligible) { unset($priceList[$priceKey]); continue; } + /* select a lower price for each quantity */ if (isset($qtyCache[$price['price_qty']])) { $priceQty = $qtyCache[$price['price_qty']]; diff --git a/app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml b/app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml index cdc16dc139e6b..87703eac6f3c1 100644 --- a/app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml +++ b/app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml @@ -73,7 +73,7 @@ $product = $block->getSaleableItem(); ); ?> getShowDetailedPrice() !== false): ?> -   +   getSavePercent($price['price']) ?>% From 434138c5de03942c626597d0b0f72649361ccb53 Mon Sep 17 00:00:00 2001 From: Mike Weis Date: Mon, 16 Mar 2015 16:20:49 -0500 Subject: [PATCH 2/2] MAGETWO-35054: Tier price message not shown in product page for some customer groups - updated per code review --- app/code/Magento/Catalog/Pricing/Price/TierPrice.php | 10 ++-------- .../base/templates/product/price/tier_prices.phtml | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Catalog/Pricing/Price/TierPrice.php b/app/code/Magento/Catalog/Pricing/Price/TierPrice.php index 34b8239a51321..1a7e1dcc8c24b 100644 --- a/app/code/Magento/Catalog/Pricing/Price/TierPrice.php +++ b/app/code/Magento/Catalog/Pricing/Price/TierPrice.php @@ -162,17 +162,11 @@ protected function filterTierPrices(array $priceList) $qtyCache = []; foreach ($priceList as $priceKey => $price) { /* filter price by customer group */ - $eligible = false; - if ($price['cust_group'] == $this->customerGroup) { - $eligible = true; - } elseif ($price['cust_group'] == $this->groupManagement->getAllCustomersGroup()->getId()) { - $eligible = true; - } - if (!$eligible) { + if ($price['cust_group'] != $this->customerGroup && + $price['cust_group'] != $this->groupManagement->getAllCustomersGroup()->getId()) { unset($priceList[$priceKey]); continue; } - /* select a lower price for each quantity */ if (isset($qtyCache[$price['price_qty']])) { $priceQty = $qtyCache[$price['price_qty']]; diff --git a/app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml b/app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml index 87703eac6f3c1..466a9519bc67f 100644 --- a/app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml +++ b/app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml @@ -73,8 +73,8 @@ $product = $block->getSaleableItem(); ); ?> getShowDetailedPrice() !== false): ?> -   - getSavePercent($price['price']) ?>% +    +  getSavePercent($price['price']) ?>%