• Resolved chipzakje

    (@chipzakje)


    Hey!

    I have an import to update the stock through .CSV. The import should set the stock value on 0 if the field in the .CSV is below 4 or lower, else it should import the value in .CSV
    Currently i’m struggling to get this working and tried different expressions in the Woocommerce stock field.

    What I tried
    concat(substring(‘0’, /node/stock_field[1] < “5”), substring(/node/stock_field[1], /node/stock_field[1] >= “5”))

    concat(substring(‘0’, 1 div ({stock_field[1]} < 5)), {stock_field[1]} >= 5][1])

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hey @chipzakje,

    You would need to use an IF statement to determine what value to import here. Since you mentioned that the element is {stock_field[1]} in your example, this statement should work for you:

    [IF({stock_field[. < 4]})]0[ELSE]{stock_field[1]}[ENDIF]
Viewing 1 replies (of 1 total)
  • The topic ‘Edit stock value based on expression’ is closed to new replies.