Skip to content

Commit 434138c

Browse files
author
Mike Weis
committed
MAGETWO-35054: Tier price message not shown in product page for some customer groups
- updated per code review
1 parent f134946 commit 434138c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,11 @@ protected function filterTierPrices(array $priceList)
162162
$qtyCache = [];
163163
foreach ($priceList as $priceKey => $price) {
164164
/* filter price by customer group */
165-
$eligible = false;
166-
if ($price['cust_group'] == $this->customerGroup) {
167-
$eligible = true;
168-
} elseif ($price['cust_group'] == $this->groupManagement->getAllCustomersGroup()->getId()) {
169-
$eligible = true;
170-
}
171-
if (!$eligible) {
165+
if ($price['cust_group'] != $this->customerGroup &&
166+
$price['cust_group'] != $this->groupManagement->getAllCustomersGroup()->getId()) {
172167
unset($priceList[$priceKey]);
173168
continue;
174169
}
175-
176170
/* select a lower price for each quantity */
177171
if (isset($qtyCache[$price['price_qty']])) {
178172
$priceQty = $qtyCache[$price['price_qty']];

app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ $product = $block->getSaleableItem();
7373
);
7474
?><?php echo __('each') ?>
7575
<?php if ($block->getShowDetailedPrice() !== false): ?>
76-
<?php echo __(' and') ?>&nbsp;<strong class="benefit"><?php echo __('save ')?>
77-
<span class="percent tier-<?php echo $index ?>"><?php echo $tierPriceModel->getSavePercent($price['price']) ?></span>%
76+
&nbsp;<?php echo __('and') ?>&nbsp;<strong class="benefit"><?php echo __('save')?>
77+
<span class="percent tier-<?php echo $index ?>">&nbsp;<?php echo $tierPriceModel->getSavePercent($price['price']) ?></span>%
7878
</strong>
7979
<?php endif ?>
8080
<?php endif; ?>

0 commit comments

Comments
 (0)