Announcement

Collapse
No announcement yet.

A range conditional

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A range conditional

    Having a <mvt:duh> moment </mvt:duh> - how do I check for a range? Less than 5 but not 0. (4 through 1) - it's to check for an inventory level

    Code:
    <mvt:if expr="l.settings:product:inv_available LT '5'">
    <div id="js-inventory-message" class="column whole np">
    &mvt:product:inv_short;
    </div>
    </mvt:if>
    This works great except that it shows the 0 (Out of stock) level too. I just want to show the "low" level.

    Thanks!
    Leslie

    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    Code:
    <mvt:if expr="l.settings:product:inv_available GE 1 AND l.settings:product:inv_available LE 4">
    do something
    </mvt:if>
    or

    Code:
    <mvt:if expr="l.settings:product:inv_available GE 1 AND l.settings:product:inv_available LT 5">
    do something
    </mvt:if>
    M.A.D.* since 1997

    http://www.scotsscripts.com

    *miva application developers

    Comment


      #3
      More information on logic operators here: http://www.mivascript.com/topic/operators.html

      Comment


        #4
        Originally posted by Scot - ScotsScripts.com View Post
        Code:
        <mvt:if expr="l.settings:product:inv_available GE 1 AND l.settings:product:inv_available LE 4">
        do something
        </mvt:if>
        or

        Code:
        <mvt:if expr="l.settings:product:inv_available GE 1 AND l.settings:product:inv_available LT 5">
        do something
        </mvt:if>
        Thanks Scot - LOL when I saw this the first thing I thought of was an old GE slogan "We bring good things to life"
        Leslie Kirk
        Miva Certified Developer
        Miva Merchant Specialist since 1997
        Previously of Webs Your Way
        (aka Leslie Nord leslienord)

        Email me: [email protected]
        www.lesliekirk.com

        Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

        Comment


          #5
          Originally posted by RTHOMASDESIGN View Post
          More information on logic operators here: http://www.mivascript.com/topic/operators.html
          Thanks Ryan - a bit of brain mush going on (and I can't even blame it all on the Current Events).
          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

          Comment

          Working...
          X