Here are some example WP All Import [IF] statements. The criteria for an IF statment is written in XPath 1.0 syntax and can use XPath functions. Although powerful, XPath syntax can be quite complex. In many cases it might be easier to use a PHP function as shown here.
Note: The [ELSE]<something>
part is optional
[IF({price[.=0]})]Zero[ELSE]Not Zero[ENDIF]
[IF({price[.>0]})]Greater than 0[ENDIF]
[IF({title[.='Foo']})]The title is Foo[ENDIF]
[IF({title[.!='Foo']})]The title is not Foo[ENDIF]
[IF({title[.='']})]The title is empty[ENDIF]
[IF({title[contains(.,’Foo')]})]Has foo[ENDIF]
[IF({title[string-length()>10]})]{title}[ENDIF]
[IF({title[.='']})]The title is empty[ELSE]{title}[ENDIF]
Note: You might have seen examples using not(text())
to check for empty fields. While this is valid XPath syntax, it seems to fail on some servers. The reasons are unclear. Just use the Text is empty syntax above instead.
Hi @m-thomson
thanks for your quick answer. I dont know exactly how to use that.
I have this selection {reifenbreite[1]}/{reifenquerschnitt[1]}/{reifenbauart[1]}{reifendurchmesser[1]} in my title.
Some filed that i import has 0 {reifenbreite[1]} or 0 {reifenquerschnitt[1]}. This kind of field i dont want to import.
How can i do that please with syntax [IF({title[.!='Foo']})]The title is not Foo[ENDIF]