WIP: Frontend resolution of catalog rule pricing

This commit is contained in:
Prashant Singh 2019-08-22 18:57:35 +05:30
parent c21ad00ece
commit fb52c4bffc
2 changed files with 7 additions and 6 deletions

View File

@ -119,10 +119,8 @@ class Apply extends Sale
$this->setSale($rule, $productIDs);
}
}
// dd($result, 'processing done');
} else {
// handle the deceased rules here
// handle the deceased rules here or call the declutter handler over here
// dd($this->deceased);
}
}
@ -196,6 +194,8 @@ class Apply extends Sale
$winnerRuleId = $this->breakTie($previousRuleID, $newRuleID, $product);
$discountAmount = $this->getDiscountAmount($product, $rule);
$data = [
'catalog_rule_id' => $rule->id,
'starts_from' => $rule->starts_from,
@ -204,7 +204,7 @@ class Apply extends Sale
'channel_id' => $channelId,
'product_id' => $productID,
'action_code' => $rule->action_code,
'action_amount' => $discountPrice
'action_amount' => $discountAmount
];
if ($rule->id == $winnerRuleId) {

View File

@ -71,6 +71,7 @@ class Price extends AbstractProduct
}
$qb = ProductFlat::join('products', 'product_flat.product_id', '=', 'products.id')
->join('catalog_rule_products', 'catalog_rule_products.product_id', '=', 'products.id')
->where('products.parent_id', $productId);
$result = $qb