This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed
Catalog/view/base/templates/product/price
view/base/templates/product/price
Wishlist/Pricing/ConfiguredPrice Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ // @codingStandardsIgnoreFile
8
+
6
9
?>
10
+
7
11
<?php
8
12
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */
9
13
/** @var \Magento\Catalog\Pricing\Price\ConfiguredPrice $configuredPrice */
@@ -14,11 +18,13 @@ $priceLabel = ($block->getPriceLabel() !== null)
14
18
: '' ;
15
19
?>
16
20
<p class="price-as-configured">
17
- <?= /* @escapeNotVerified */ $ block ->renderAmount ($ configuredPrice ->getAmount (), [
18
- 'display_label ' => $ priceLabel ,
19
- 'price_id ' => $ block ->getPriceId ('product-price- ' ),
20
- 'price_type ' => 'finalPrice ' ,
21
- 'include_container ' => true ,
22
- 'schema ' => $ schema
23
- ]); ?>
21
+ <?php if ($ configuredPrice ->getAmount ()->getValue () !== null ): ?>
22
+ <?= /* @noEscape */ $ block ->renderAmount ($ configuredPrice ->getAmount (), [
23
+ 'display_label ' => $ priceLabel ,
24
+ 'price_id ' => $ block ->getPriceId ('product-price- ' ),
25
+ 'price_type ' => 'finalPrice ' ,
26
+ 'include_container ' => true ,
27
+ 'schema ' => $ schema
28
+ ]); ?>
29
+ <?php endif ; ?>
24
30
</p>
Original file line number Diff line number Diff line change @@ -55,8 +55,7 @@ public function __construct(
55
55
56
56
/**
57
57
* @param \Magento\Framework\Pricing\SaleableInterface|\Magento\Catalog\Model\Product $product
58
- * @return float
59
- * @throws \Magento\Framework\Exception\LocalizedException
58
+ * @return float|null
60
59
*/
61
60
public function resolvePrice (\Magento \Framework \Pricing \SaleableInterface $ product )
62
61
{
@@ -67,6 +66,6 @@ public function resolvePrice(\Magento\Framework\Pricing\SaleableInterface $produ
67
66
$ price = $ price ? min ($ price , $ productPrice ) : $ productPrice ;
68
67
}
69
68
70
- return (float )$ price ;
69
+ return $ price === null ? null : (float )$ price ;
71
70
}
72
71
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ $schema = ($block->getZone() == 'item_view') ? true : false;
38
38
'skip_adjustments ' => true
39
39
]); ?>
40
40
</span>
41
- <?php else : ?>
41
+ <?php elseif ( $ finalPriceModel -> getAmount ()-> getValue () !== null ) : ?>
42
42
<?php /* @escapeNotVerified */ echo $ block ->renderAmount ($ finalPriceModel ->getAmount (), [
43
43
'price_id ' => $ block ->getPriceId ('product-price- ' . $ idSuffix ),
44
44
'price_type ' => 'finalPrice ' ,
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public function getValue()
26
26
$ product = $ customOption ? $ customOption ->getProduct () : $ this ->getProduct ();
27
27
$ price = $ product ->getPriceInfo ()->getPrice (self ::PRICE_CODE )->getValue ();
28
28
29
- return max (0 , $ price );
29
+ return $ price === null ? null : max (0 , $ price );
30
30
}
31
31
32
32
/**
You can’t perform that action at this time.
0 commit comments