Announcement

Collapse
No announcement yet.

Hiding Products From Feed

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

  • Hiding Products From Feed

    I'm trying to write logic for a checkbox custom field. Simple, IF CHECKED, show this product in the feed. I'm banging my head against a wall not able to get it to work....

    HTML Code:
    <mvt:if expr="l.settings:record:inventory NE '0' AND l.settings:record:customfield:wwefeed EQ 'Yes'">Show it</mvt:if>
    Anyone tell me what moronic thing I'm doing wrong?
    Ted Hust
    AarcMediaGroup.com

    Celebrating 13 Years of Outstanding Service & Support
    Miva Merchant Design

  • its a boolen field so it should return on 1 or nothing...so, i just use

    <mvt:if expr="l.settings:pm:thisCheckbox">

    or

    <mvt:if expr="NOT(l.settings:pm:thisCheckbox)">

    cause its less typing
    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


    • I'd take a closer look at the other half of the expression, l.settings:record:inventory. If that's coming up zero every time, it will prevent the records from being shown.

      Also, are you sure that l.settings:record:customfield:wwefeed is the correct variable name? IIRC, Miva custom fields used to require a longer expression, something like l.settings:record:customfield_values:customfields: wwefeed.

      HTH --
      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


      • I second Bruce's point, the checkbox is a boolean, so simply testing for the existence will return the result you want.

        Two additional points
        - I strongly recommend using less than or equal to (LE) on your inventory test, just a CYA in the event that an item is oversold and ends up with a negative inventory level.
        - Is the custom field selected to be included in the feed? I'm guilty of overlooking this quite often.

        HTML Code:
          <mvt:if expr="NOT(l.settings:record:inventory LE '0') AND l.settings:record:customfield:wwefeed">Show it</mvt:if>
        Last edited by kocourek; 10-11-19, 06:19 AM.

        Comment


        • What through me was in the back end, it shows as No or Yes, so I was thinking that may be the actual value, because I am able to put anything in that field I want.

          Also, yes I tried the version that also included customfield_values and that didn't work either, hence me trying the shorter version.

          I'll try the suggestions here and will report back.
          Ted Hust
          AarcMediaGroup.com

          Celebrating 13 Years of Outstanding Service & Support
          Miva Merchant Design

          Comment


          • Token List should show what the actual variables available are.
            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