Skip to content

Commit

Permalink
MC-15085: Cannot install Magento without ConfigurableProduct module
Browse files Browse the repository at this point in the history
  • Loading branch information
fascinosum committed Mar 3, 2019
1 parent c3effa5 commit db2e9f0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ interface MsrpPriceCalculatorInterface
* @return float
*/
public function getMsrpPriceValue(ProductInterface $product): float;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ public function getMsrpPriceValue(ProductInterface $product): float

/** @var Configurable $configurableProduct */
$configurableProduct = $product->getTypeInstance();
$msrp = 0;
$prices = [];
foreach ($configurableProduct->getUsedProducts($product) as $item) {
if ($item->getMsrp() !== null) {
$prices[] = $item->getMsrp();
}
}
if ($prices) {
$msrp = (float)max($prices);
}

return $prices ? max($prices) : 0;
return $msrp;
}
}
3 changes: 3 additions & 0 deletions app/code/Magento/MsrpConfigurableProduct/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MsrpConfigurableProduct

**MsrpConfigurableProduct** provides type and resolver information for the Msrp module from the ConfigurableProduct module.
3 changes: 3 additions & 0 deletions app/code/Magento/MsrpGroupedProduct/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MsrpGroupedProduct

**MsrpGroupedProduct** provides type and resolver information for the Msrp module from the GroupedProduct module.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
"magento/module-media-storage": "*",
"magento/module-message-queue": "*",
"magento/module-msrp": "*",
"magento/module-msrp-configurable-product": "*",
"magento/module-msrp-grouped-product": "*",
"magento/module-multishipping": "*",
"magento/module-mysql-mq": "*",
"magento/module-new-relic-reporting": "*",
Expand Down

0 comments on commit db2e9f0

Please sign in to comment.