Skip to content
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

[Backport] Fixed issue if there are multiple skus in catalog rule condition combination #21269

Merged
Merged
Changes from all 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 @@ -95,8 +95,8 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon
* @param \Magento\Catalog\Model\ResourceModel\Product $productResource
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\Collection $attrSetCollection
* @param \Magento\Framework\Locale\FormatInterface $localeFormat
* @param ProductCategoryList|null $categoryList
* @param array $data
* @param ProductCategoryList|null $categoryList
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand Down Expand Up @@ -520,6 +520,10 @@ public function loadArray($arr)
) ? $this->_localeFormat->getNumber(
$arr['is_value_parsed']
) : false;
} elseif (!empty($arr['operator']) && $arr['operator'] == '()') {
if (isset($arr['value'])) {
$arr['value'] = preg_replace('/\s*,\s*/', ',', $arr['value']);
}
}

return parent::loadArray($arr);
Expand Down Expand Up @@ -706,6 +710,7 @@ protected function _getAttributeSetId($productId)

/**
* Correct '==' and '!=' operators
*
* Categories can't be equal because product is included categories selected by administrator and in their parents
*
* @return string
Expand Down