Skip to content

Commit 2cf09f2

Browse files
author
Mike Weis
committed
MAGETWO-42753: Incorrect prices in mini shopping cart for combination of tax and FPT settings
- fixed
1 parent fa9c569 commit 2cf09f2

File tree

1 file changed

+39
-29
lines changed
  • app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price

1 file changed

+39
-29
lines changed

app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,30 @@
99
/** @var $block \Magento\Weee\Block\Item\Price\Renderer */
1010

1111
$item = $block->getItem();
12+
13+
// ensure we use the zone for the shopping cart / minicart
14+
$originalZone = $block->getZone();
15+
$block->setZone(\Magento\Framework\Pricing\Render::ZONE_CART);
1216
?>
17+
1318
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?>
14-
<span class="price-including-tax" data-label="<?php echo $block->escapeHtml(__('Incl. Tax')); ?>">
15-
<?php if ($block->displayPriceWithWeeeDetails()): ?>
16-
<span class="minicart-tax-total">
17-
<?php else: ?>
19+
<span class="price-including-tax" data-label="<?php echo $block->escapeHtml(__('Incl. Tax')); ?>">
20+
<?php if ($block->displayPriceWithWeeeDetails()): ?>
21+
<span class="minicart-tax-total">
22+
<?php else: ?>
1823
<span class="minicart-price">
19-
<?php endif; ?>
24+
<?php endif; ?>
2025
<?php /* @escapeNotVerified */ echo $block->formatPrice($block->getUnitDisplayPriceInclTax()); ?>
21-
</span>
26+
</span>
2227

28+
<?php if ($block->displayPriceWithWeeeDetails()): ?>
2329
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?>
24-
<span class="minicart-tax-info" style="display: none">
25-
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?>
26-
<span class="weee" data-label="<?php /* @escapeNotVerified */ echo $tax['title']; ?>">
27-
<?php /* @escapeNotVerified */ echo $block->formatPrice($tax['amount_incl_tax'], true, true); ?>
28-
</span>
29-
<?php endforeach; ?>
30+
<span class="minicart-tax-info">
31+
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?>
32+
<span class="weee" data-label="<?php /* @escapeNotVerified */ echo $tax['title']; ?>">
33+
<?php /* @escapeNotVerified */ echo $block->formatPrice($tax['amount_incl_tax'], true, true); ?>
34+
</span>
35+
<?php endforeach; ?>
3036
</span>
3137

3238
<?php if ($block->displayFinalPrice()): ?>
@@ -37,35 +43,39 @@ $item = $block->getItem();
3743
</span>
3844
<?php endif; ?>
3945
<?php endif; ?>
40-
</span>
4146
<?php endif; ?>
47+
</span>
48+
<?php endif; ?>
4249

43-
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
50+
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
4451
<span class="price-excluding-tax" data-label="<?php echo $block->escapeHtml(__('Excl. Tax')); ?>">
45-
<?php if ($block->displayPriceWithWeeeDetails()): ?>
52+
<?php if ($block->displayPriceWithWeeeDetails()): ?>
4653
<span class="minicart-tax-total">
47-
<?php else: ?>
48-
<span class="minicart-price">
49-
<?php endif; ?>
54+
<?php else: ?>
55+
<span class="minicart-price">
56+
<?php endif; ?>
5057
<?php /* @escapeNotVerified */ echo $block->formatPrice($block->getUnitDisplayPriceExclTax()); ?>
51-
</span>
58+
</span>
5259

53-
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?>
54-
<span class="minicart-tax-info">
55-
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?>
56-
<span class="weee" data-label="<?php /* @escapeNotVerified */ echo $tax['title']; ?>">
57-
<?php /* @escapeNotVerified */ echo $block->formatPrice($tax['amount'], true, true); ?>
58-
</span>
59-
<?php endforeach; ?>
60+
<?php if ($block->displayPriceWithWeeeDetails()): ?>
61+
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?>
62+
<span class="minicart-tax-info">
63+
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?>
64+
<span class="weee" data-label="<?php /* @escapeNotVerified */ echo $tax['title']; ?>">
65+
<?php /* @escapeNotVerified */ echo $block->formatPrice($tax['amount'], true, true); ?>
66+
</span>
67+
<?php endforeach; ?>
6068
</span>
6169

6270
<?php if ($block->displayFinalPrice()): ?>
63-
<span class="minicart-tax-total">
71+
<span class="minicart-tax-total">
6472
<span class="weee" data-label="<?php echo $block->escapeHtml(__('Total')); ?>">
6573
<?php /* @escapeNotVerified */ echo $block->formatPrice($block->getFinalUnitDisplayPriceExclTax()); ?>
6674
</span>
6775
</span>
68-
<?php endif; ?>
6976
<?php endif; ?>
70-
</span>
7177
<?php endif; ?>
78+
<?php endif; ?>
79+
</span>
80+
<?php endif; ?>
81+
<?php $block->setZone($originalZone); ?>

0 commit comments

Comments
 (0)