Skip to content

Commit

Permalink
Fix > Exception #0 (BadMethodCallException): Missing required argumen…
Browse files Browse the repository at this point in the history
…t $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator.
  • Loading branch information
lfluvisotto committed Apr 8, 2019
1 parent 5791131 commit fc26316
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ class MsrpPriceCalculator implements MsrpPriceCalculatorInterface
/**
* @param array $msrpPriceCalculators
*/
public function __construct(array $msrpPriceCalculators)
public function __construct(?array $msrpPriceCalculators = null)
{
$this->msrpPriceCalculators = $this->getMsrpPriceCalculators($msrpPriceCalculators);
/*
* This is a workaround for the case of modules Magento_MsrpConfigurableProduct and Magento_MsrpGroupedProduct
* are disabled.
*/
if (\is_array($msrpPriceCalculators)) {
$this->msrpPriceCalculators = $this->getMsrpPriceCalculators($msrpPriceCalculators);
}
}

/**
Expand Down

0 comments on commit fc26316

Please sign in to comment.