Skip to content

Commit a7620f3

Browse files
author
Anna Bukatar
committed
ACP2E-313: Tiered Pricing display on PDP
1 parent 5ca6fc5 commit a7620f3

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ protected function filterTierPrices(array $priceList)
217217
unset($priceList[$priceKey]);
218218
continue;
219219
}
220-
$minPrice = $price['price'];
221220
if (isset($price['price_qty']) && $price['price_qty'] == 1) {
222221
unset($priceList[$priceKey]);
223222
continue;
@@ -240,6 +239,7 @@ protected function filterTierPrices(array $priceList)
240239
} else {
241240
$qtyCache[$price['price_qty']] = $priceKey;
242241
}
242+
$minPrice = $price['price'];
243243
}
244244
return array_values($priceList);
245245
}

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,8 @@
8484
<expectedResult type="string">Buy {{tierPriceOnDefault.qty_0}} for ${{tierPriceOnDefault.price_0}} each and save 100%</expectedResult>
8585
<actualResult type="variable">firstTierPriceText</actualResult>
8686
</assertEquals>
87-
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('2', tierPriceOnDefault.qty_1)}}" stepKey="secondTierPriceText"/>
88-
<assertEquals stepKey="assertTierPriceTextOnProductPage2">
89-
<expectedResult type="string">Buy {{tierPriceOnDefault.qty_1}} for ${{tierPriceOnDefault.price_1}} each and save 100%</expectedResult>
90-
<actualResult type="variable">secondTierPriceText</actualResult>
91-
</assertEquals>
87+
<dontSeeElement selector="{{StorefrontProductInfoMainSection.productTierPriceByForTextLabel('2', tierPriceOnDefault.qty_1)}}" stepKey="secondTierPriceText"/>
88+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertTierPriceTextOnProductPage2"/>
9289

9390
<!-- Verify customer see product out of stock status on product page -->
9491
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/>

app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Magento\Framework\Pricing\Price\PriceInterface;
2323
use Magento\Framework\Pricing\PriceCurrencyInterface;
2424
use Magento\Framework\Pricing\PriceInfo\Base;
25+
use Magento\Framework\App\Config\ScopeConfigInterface;
2526
use PHPUnit\Framework\MockObject\MockObject;
2627
use PHPUnit\Framework\TestCase;
2728

@@ -113,7 +114,7 @@ protected function setUp(): void
113114
$this->groupManagement = $this->getMockForAbstractClass(GroupManagementInterface::class);
114115

115116
$this->priceCurrencyMock = $this->getMockForAbstractClass(PriceCurrencyInterface::class);
116-
$this->scopeConfigMock = $this->getMockForAbstractClass(\Magento\Framework\App\Config\ScopeConfigInterface::class);
117+
$this->scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
117118

118119
$this->model = new TierPrice(
119120
$this->product,

0 commit comments

Comments
 (0)