-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2185 from magento-tango/2.2.4-PR-part-1
Bugs: - MAGETWO-71936 [GitHub] Error: Invalid input datetime format of value "'DD/MM/+********"'. - MAGETWO-73479 Cart Rules are not excluding Bundle Products - MAGETWO-84921 Swagger does not render correctly for many POST/PUT operations - MAGETWO-89045 FATAL error on compiler generation on PHP 7.0.11
- Loading branch information
Showing
67 changed files
with
758 additions
and
30,814 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
app/code/Magento/SalesRule/Model/Quote/ChildrenValidationLocator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\SalesRule\Model\Quote; | ||
|
||
use \Magento\Quote\Model\Quote\Item\AbstractItem as QuoteItem; | ||
|
||
/** | ||
* Class ChildrenValidationLocator | ||
* | ||
* Used to determine necessity to validate rule on item's children that may depends on product type | ||
*/ | ||
class ChildrenValidationLocator | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $productTypeChildrenValidationMap; | ||
|
||
/** | ||
* @param array $productTypeChildrenValidationMap | ||
* <pre> | ||
* [ | ||
* 'ProductType1' => true, | ||
* 'ProductType2' => false | ||
* ] | ||
* </pre> | ||
*/ | ||
public function __construct( | ||
array $productTypeChildrenValidationMap = [] | ||
) { | ||
$this->productTypeChildrenValidationMap = $productTypeChildrenValidationMap; | ||
} | ||
|
||
/** | ||
* Checks necessity to validate rule on item's children | ||
* | ||
* @param QuoteItem $item | ||
* @return bool | ||
*/ | ||
public function isChildrenValidationRequired(QuoteItem $item): bool | ||
{ | ||
$type = $item->getProduct()->getTypeId(); | ||
if (isset($this->productTypeChildrenValidationMap[$type])) { | ||
return (bool)$this->productTypeChildrenValidationMap[$type]; | ||
} | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.