问题
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?
回答1:
Try this instead:
{if !($conta|contains:"word1" || $conta|contains:"word2") && ($product->id_category_default < 388 || $product->id_category_default > 475)}
来源:https://stackoverflow.com/questions/6717436/smarty-3-if-mixed-conditions-operators