Skip to content

Commit 6e9aeff

Browse files
committed
MAGETWO-69634: Product with a special price must be showed with this price in the wishlist
1 parent c359261 commit 6e9aeff

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

app/code/Magento/Bundle/Pricing/Price/ConfiguredRegularPrice.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
/**
1111
* Configured regular price model
12-
* @api
1312
*/
1413
class ConfiguredRegularPrice extends ConfiguredPrice
1514
{

app/code/Magento/Catalog/Pricing/Render/ConfiguredPriceBox.php

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,60 @@
77
namespace Magento\Catalog\Pricing\Render;
88

99
use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface;
10+
use Magento\Catalog\Model\Product\Pricing\Renderer\SalableResolverInterface;
11+
use Magento\Catalog\Pricing\Price\MinimalPriceCalculatorInterface;
1012
use Magento\Framework\Pricing\Price\PriceInterface;
1113
use Magento\Catalog\Pricing\Price\ConfiguredPriceInterface;
1214
use Magento\Catalog\Pricing\Price\FinalPrice;
1315
use Magento\Catalog\Pricing\Price\RegularPrice;
16+
use Magento\Framework\Pricing\Render\RendererPool;
17+
use Magento\Framework\Pricing\SaleableInterface;
18+
use Magento\Framework\View\Element\Template\Context;
1419

1520
/**
1621
* Class for configured_price rendering
1722
*/
1823
class ConfiguredPriceBox extends FinalPriceBox
1924
{
25+
/**
26+
* @var \Magento\Catalog\Pricing\Price\ConfiguredPriceSelection
27+
*/
28+
private $configuredPriceSelection;
29+
30+
/**
31+
* @param Context $context
32+
* @param SaleableInterface $saleableItem
33+
* @param PriceInterface $price
34+
* @param RendererPool $rendererPool
35+
* @param array $data
36+
* @param SalableResolverInterface|null $salableResolver
37+
* @param MinimalPriceCalculatorInterface|null $minimalPriceCalculator
38+
* @param \Magento\Catalog\Pricing\Price\ConfiguredPriceSelection|null $configuredPriceSelection
39+
*/
40+
public function __construct(
41+
Context $context,
42+
SaleableInterface $saleableItem,
43+
PriceInterface $price,
44+
RendererPool $rendererPool,
45+
array $data = [],
46+
SalableResolverInterface $salableResolver = null,
47+
MinimalPriceCalculatorInterface $minimalPriceCalculator = null,
48+
\Magento\Catalog\Pricing\Price\ConfiguredPriceSelection $configuredPriceSelection = null
49+
) {
50+
$this->configuredPriceSelection = $configuredPriceSelection
51+
?: \Magento\Framework\App\ObjectManager::getInstance()
52+
->get(\Magento\Catalog\Pricing\Price\ConfiguredPriceSelection::class);
53+
parent::__construct(
54+
$context,
55+
$saleableItem,
56+
$price,
57+
$rendererPool,
58+
$data,
59+
$salableResolver,
60+
$minimalPriceCalculator
61+
);
62+
}
63+
2064
/**
2165
* Retrieve an item instance to the configured price model
2266
*
@@ -60,7 +104,7 @@ public function getConfiguredPrice()
60104
{
61105
/** @var \Magento\Bundle\Pricing\Price\ConfiguredPrice $configuredPrice */
62106
$configuredPrice = $this->getPrice();
63-
if (empty($configuredPrice->getSelectionPriceList())) {
107+
if (empty($this->configuredPriceSelection->getSelectionPriceList($configuredPrice))) {
64108
// If there was no selection we must show minimal regular price
65109
return $this->getSaleableItem()->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE);
66110
}
@@ -75,7 +119,7 @@ public function getConfiguredRegularPrice()
75119
{
76120
/** @var \Magento\Bundle\Pricing\Price\ConfiguredPrice $configuredPrice */
77121
$configuredPrice = $this->getPriceType(ConfiguredPriceInterface::CONFIGURED_REGULAR_PRICE_CODE);
78-
if (empty($configuredPrice->getSelectionPriceList())) {
122+
if (empty($this->configuredPriceSelection->getSelectionPriceList($configuredPrice))) {
79123
// If there was no selection we must show minimal regular price
80124
return $this->getSaleableItem()->getPriceInfo()->getPrice(RegularPrice::PRICE_CODE);
81125
}

0 commit comments

Comments
 (0)