Skip to content

Commit fc26316

Browse files
committed
Fix > Exception #0 (BadMethodCallException): Missing required argument $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator.
1 parent 5791131 commit fc26316

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ class MsrpPriceCalculator implements MsrpPriceCalculatorInterface
2323
/**
2424
* @param array $msrpPriceCalculators
2525
*/
26-
public function __construct(array $msrpPriceCalculators)
26+
public function __construct(?array $msrpPriceCalculators = null)
2727
{
28-
$this->msrpPriceCalculators = $this->getMsrpPriceCalculators($msrpPriceCalculators);
28+
/*
29+
* This is a workaround for the case of modules Magento_MsrpConfigurableProduct and Magento_MsrpGroupedProduct
30+
* are disabled.
31+
*/
32+
if (\is_array($msrpPriceCalculators)) {
33+
$this->msrpPriceCalculators = $this->getMsrpPriceCalculators($msrpPriceCalculators);
34+
}
2935
}
3036

3137
/**

0 commit comments

Comments
 (0)