getEligble items in action fixed as its was not working as boolean expression

This commit is contained in:
Prashant Singh 2019-09-13 12:22:50 +05:30
parent d02c903470
commit 685aedf528
3 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ abstract class Action
foreach ($items as $item) {
foreach ($matchingIDs as $matchingID) {
if ($matchingID == $item->child ? $item->child->product_id : $item->product_id) {
if ($matchingID == ($item->child ? $item->child->product_id : $item->product_id)) {
$matchedItems->push($item);
}
}

View File

@ -23,7 +23,7 @@ class FixedAmount extends Action
foreach ($matchIDs as $matchID) {
foreach ($eligibleItems as $item) {
if ($item->child ? $item->child->product_id : $item->product_id == $matchID) {
if (($item->child ? $item->child->product_id : $item->product_id) == $matchID) {
return true;
}
}

View File

@ -30,7 +30,7 @@ class PercentOfProduct extends Action
foreach ($matchIDs as $matchID) {
foreach ($eligibleItems as $item) {
if ($item->child ? $item->child->product_id : $item->product_id == $matchID) {
if (($item->child ? $item->child->product_id : $item->product_id) == $matchID) {
return true;
}
}