Announcement

Collapse
No announcement yet.

Why this conditional in TEMPLATEFEED always render "in stock"?

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

  • Why this conditional in TEMPLATEFEED always render "in stock"?

    Why would the following conditional in TEMPLATEFEED always render "in stock" in:

    Code:
    <mvt:if expr="l.settings:product:inv_level EQ 'low'">in stock<mvt:elseif expr="l.settings:product:inv_level EQ 'out'">out of stock<mvt:else>in stock</mvt:if>
    Thank you, Bill Davis

  • I'll guess that l.settings:product:inv_level is not being initialized properly, so it's empty. For testing purposes, I'd put a line of code in the template to show the value of product:inv_level on my screen -- or into the output file, or wherever the results are going.
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


    • not an expert with the Miva based feeds, but all the ones I've looked at use 'record' as the iterator so you need to be testing for l.settings:record:inv_level.

      also, unlike other product arrays, you must specifically list (in the settings area) the parts of the product record you want.
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


      • Originally posted by Kent Multer View Post
        I'll guess that l.settings:product:inv_level is not being initialized properly, so it's empty. For testing purposes, I'd put a line of code in the template to show the value of product:inv_level on my screen -- or into the output file, or wherever the results are going.
        Dont understand.
        Thank you, Bill Davis

        Comment


        • Try this:

          Code:
           
           <mvt:if expr="l.settings:record:inv_level EQ 'low'">in stock<mvt:elseif expr="l.settings:record:inv_level EQ 'out'">out of stock<mvt:else>in stock</mvt:if>
          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment

          Working...
          X

          This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

          This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

          Accept