WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Bug when using more than 2 variable with AND

[Resolved] Bug when using more than 2 variable with AND

  • scattered810
    Member

    @scattered810

    I don’t see why this is not working, other than there being a bug that only allows two variables for AND statements.
    I am testing the following, which is part of a much larger string.
    IF(AND(stock=1,color=1,sides=1,(t1001*q),IF(AND(stock=2,color=1,sides=1),(t1002*q),IF(AND(stock=3,color=1,sides=1),(t1003*q))))

    If stock value is 1 and color value is 1 and sides value is 1, I want functionID: t1001 to be multiplied by q (quantity)

    If stock value is 2 and color value is 1 and sides value is 1, I want functionID: t1002 to be multiplied by q (quantity)

    http://wordpress.org/extend/plugins/jazzy-forms/

Viewing 1 replies (of 1 total)
  • scattered810
    Member

    @scattered810

    Thanks to raulelenes, he posted his code which I applied to mine. Works like a charm.

    IF(AND(stock=1,AND(color=1,sides=1)),(t1001*q),IF(AND(stock=2,AND(color=1,sides=1)),(t1002*q),IF(AND(stock=3,AND(color=1,sides=1)),(t1003*q))))

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Bug when using more than 2 variable with AND’ is closed to new replies.