Skip to content

Sales: and/or condition for categoriesΒ #2105

@billmn

Description

@billmn

What are you trying to do?
I have, for instance, two categories: "Brands" and "Gender".
I would apply a sale on "Nike / Men" (e.g. 10% discount) and a different sale on "Nike / Women" (e.g. 20% discount).

Now is not possible because it uses an OR condition between categories.

What's your proposed solution?
What about add a field in "Sale -> Matching Items" section that allow to choose the and/or condition?

"OR" condition: limit the discount to one or more categories (as default, like now)
"AND" condition: limit the discount to the combination of all specified categories

Could be enough change the relatedTo call here?

$relatedCategories = Category::find()->id($saleCategories)->relatedTo($relatedTo)->ids();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions