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

fix boolean logic whith 'not one of' condition #4373

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zerrac
Copy link

@zerrac zerrac commented Nov 21, 2024

Description

When using condition "not one of" on multiple categories, products are matched when absent of just one of the categories.

pre-fix where condition :

" ((NOT FIND_IN_SET('5',`ccp`.`category_id`) OR NOT FIND_IN_SET('55',`ccp`.`category_id`) OR NOT FIND_IN_SET('80',`ccp`.`category_id`) OR NOT FIND_IN_SET('148',`ccp`.`category_id`))) "

post-fix where condition :

" ((NOT FIND_IN_SET('5',`ccp`.`category_id`) AND NOT FIND_IN_SET('55',`ccp`.`category_id`) AND NOT FIND_IN_SET('80',`ccp`.`category_id`) AND NOT FIND_IN_SET('148',`ccp`.`category_id`))) "

# Step to reproduce

  • Try to apply a promotion on all products but those in two categories
  • Products in the two categories are excluded
  • Products in only one category are not

@github-actions github-actions bot added the Component: Rule Relates to Mage_Rule label Nov 21, 2024
@kiatng
Copy link
Contributor

kiatng commented Nov 28, 2024

I tried to replicate with sample data in DDEV.
I discount $1 on all products except 2 categories: Electronics and VIP. In frontend, the rule is applied correctly.

What am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants