Trouble displaying a custom field within a Toolkit snippet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lesliekirk
    Super Moderator











    • Aug 2008
    • 9290

    #1

    Trouble displaying a custom field within a Toolkit snippet

    Didn't want to bug Bill (but I'm sure he will chime in), but I'm having trouble getting the custom product field to display within this snippet I've used to create a product list for a specific category on the SFNT screen:

    Code:
    <mvt:item name="toolkit" param="sassign|cat_codes1|mycatcodehere" />
    <mvt:item name="toolkit" param="cxpc|pcount|g.cat_codes1|ALL" />
    <mvt:if expr="pcount GT 0">
    <mvt:foreach iterator="sub_product" array="sub_products">
    - <a href="/&mvta:sub_product:code;.html">
    <mvt:item name="toolkit" param="custom|short|l.all_settings:item:sub_product_id|shortprodname" />
    <mvt:if expr="g.short">
    &mvte:global:short;
    <mvt:else>
    ->&mvt:sub_product:name;</mvt:if></a><br>
    </mvt:foreach>
    </mvt:if>
    The product names appear perfectly, along with the link to the product - I just can't get the custom product field "shortprodname" to display (if there is one). I have double check to make sure the products do have a value in the custom product field.

    Any thoughts?

    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: X | Facebook | Pinterest
  • nottheusual1
    Mega Mivite


    • Jul 2008
    • 1124

    #2
    Re: Trouble displaying a custom field within a Toolkit snippet

    try this instead since you know the sub_product code is ok?

    Code:
    <mvt:item name="toolkit" param="customc|short|l.all_settings:item:sub_product:code|shortprodname" />

    Comment

    • lesliekirk
      Super Moderator











      • Aug 2008
      • 9290

      #3
      Re: Trouble displaying a custom field within a Toolkit snippet

      I was soooo hopeful that would work, but it didn't.
      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: X | Facebook | Pinterest

      Comment

      • wcw
        Developer Partner

        • Mar 2006
        • 11329

        #4
        Re: Trouble displaying a custom field within a Toolkit snippet

        l.all_settings:sub_product:code

        "item" is not in that array iterator.
        Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
        Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
        Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
        Facebook http://www.facebook.com/EmporiumPlus
        Twitter http://twitter.com/emporiumplus

        Comment

        • lesliekirk
          Super Moderator











          • Aug 2008
          • 9290

          #5
          Re: Trouble displaying a custom field within a Toolkit snippet

          Thanks Bill! That was the missing piece of the puzzle
          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: X | Facebook | Pinterest

          Comment

          • lesliekirk
            Super Moderator











            • Aug 2008
            • 9290

            #6
            Re: Trouble displaying a custom field within a Toolkit snippet

            The snippet is working great - is it possible to add the ability to have the array sort by Name Acsending?

            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: X | Facebook | Pinterest

            Comment

            • wcw
              Developer Partner

              • Mar 2006
              • 11329

              #7
              Re: Trouble displaying a custom field within a Toolkit snippet

              Probably using the multisort function.
              Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
              Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
              Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
              Facebook http://www.facebook.com/EmporiumPlus
              Twitter http://twitter.com/emporiumplus

              Comment

              • lesliekirk
                Super Moderator











                • Aug 2008
                • 9290

                #8
                Re: Trouble displaying a custom field within a Toolkit snippet

                So in theory something this should work?

                Code:
                <mvt:item name="toolkit" param="sassign|cat_codes|cpap-masks-bipap-masks-circadiance" />
                <mvt:item name="toolkit" param="cxpc|pcount|g.cat_codes|ALL" />
                <mvt:item name="toolkit" param="asortmulti|l.all_settings:sub_product:code|:name|1" />
                <mvt:if expr="pcount GT 0">
                <mvt:foreach iterator="sub_product" array="sub_products">
                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: X | Facebook | Pinterest

                Comment

                • wcw
                  Developer Partner

                  • Mar 2006
                  • 11329

                  #9
                  Re: Trouble displaying a custom field within a Toolkit snippet

                  No. I believe the array would be l.all_settings:sub_products
                  Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
                  Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
                  Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
                  Facebook http://www.facebook.com/EmporiumPlus
                  Twitter http://twitter.com/emporiumplus

                  Comment

                  Working...
                  X