Skip to content

[34438] Apply catalog price rule when product price is zero but custom option has price #35533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: 2.4-develop
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function execute(
$product
);
// Apply catalog price rules to product options only if catalog price rules are applied to product.
if ($catalogRulePrice < $regularPrice) {
if ($catalogRulePrice < $regularPrice || $catalogRulePrice == 0.00 && $regularPrice == 0.00) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you add parenthesis to make it clear that you mean a || (b && c) and not (a || b) && c.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done parenthesis were added to condition.

$optionPrice = $this->getOptionPriceWithoutPriceRule($optionPriceValue, $isPercent, $regularPrice);
$totalCatalogRulePrice = $this->priceModifier->modifyPrice(
$regularPrice + $optionPrice,
Expand Down