smepie
smepie

Reputation: 509

Smarty 3: if, mixed conditions & operators

well... can you tell me why this works:

{if !$conta|contains:"word1" && ($product->id_category_default < 388 || $product->id_category_default > 475)}

and this not:

{if (!$conta|contains:"word1" || !$conta|contains:"word2") && ($product->id_category_default < 388 || $product->id_category_default > 475)}

where is the syntax error?

Upvotes: 0

Views: 18932

Answers (1)

Michael Berkowski
Michael Berkowski

Reputation: 270607

Try this instead:

{if !($conta|contains:"word1" || $conta|contains:"word2") && ($product->id_category_default < 388 ||  $product->id_category_default > 475)}

Upvotes: 8

Related Questions