WP All import if statement for WooCommerce product prices import

38 views Asked by At

I am using WP All import to import products from suppliers via JSON file. I have one custom field which is set for wholesale clients of my website and the normal sale price which I update based on prices I receive from the suppliers.

I am trying to achieve this: If the supplier provides a wholesale price equal to 0 to either leave the field empty or set it equal to the regular price.

The case for sale price is pretty much the same aside from this: Not all products have a sale price and if I set sale price to 0 which again is provided by the suppliers the clients will have 100% discount.

I am a bit confused by this explanation in the WP All import website:

\[IF({price\[.=0\]})\]Zero\[ELSE\]Not Zero\[ENDIF\]

I have tried to implement the \[IF({price\[.=0\]})\]Zero\[ELSE\]Not Zero\[ENDIF\] following the documentation in WP All Import but with no success.

1

There are 1 answers

0
Alexander On

After going here and there managed to finally find a solution for my fields. Using this IF inline:

[IF({p_price2[1][.="0"]})][ELSE]{p_price2[1]}[ENDIF]