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

two or more arguments in conditon layout #626

Open
jorgerubik opened this issue Aug 18, 2021 · 4 comments
Open

two or more arguments in conditon layout #626

jorgerubik opened this issue Aug 18, 2021 · 4 comments
Labels
question Further information is requested

Comments

@jorgerubik
Copy link

Hello, I want to add more arguments (productID) but I have not been able to achieve it, how is the structure required or is it not possible?

@jorgerubik jorgerubik added the question Further information is requested label Aug 18, 2021
@IncognitaDev
Copy link

you can pass more products ids in this way:

"conditions": [
       { "subject": "productId", "arguments": { "id": "12" }},
       { "subject": "productId", "arguments": { "id": "13" }},
       { "subject": "productId", "arguments": { "id": "16" }}
    ]

@jorgerubik
Copy link
Author

Yeah that's how I've been handling it, but it never worked for me

"conditions": [
{ "subject": "productId", "arguments": { "id": "1" }},
{ "subject": "productId", "arguments": { "id": "2" }}
],

@IncognitaDev
Copy link

IncognitaDev commented Oct 1, 2021

you have to set the matchType to any, because default is all then just work if all coditions are true, in your case its impossible.
an example:

  "condition-layout.product": {
    "props": {
     "conditions": [
       { "subject": "productId", "arguments": { "id": "12" }},
       { "subject": "productId", "arguments": { "id": "13" }},
       { "subject": "productId", "arguments": { "id": "16" }}
    ],
     "matchType": "any",
      "Then":  "",
      "Else":  ""
    }
  }

@jorgerubik
Copy link
Author

It's true, with that it already worked, thank you very much

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

No branches or pull requests

2 participants