Custom Product Field in Customer Confirmation Email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harpkit
    Mivite



    • Apr 2007
    • 189

    #1

    Custom Product Field in Customer Confirmation Email

    Short version of question:
    What is the correct code and syntax to place the contents of a custom product field in the the customer confirmation email?

    Details:
    I have a custom field to upload file path for pdf product documentation.
    I want to include a link to that in the the customer confirmation email.
    I have assigned the custom fields item to the customer confirmation email page.
    I have "selected" the custom field I want in the order contents section.
    But I can't figure out how to display the information in the email.

    I can get a link to display just fine on the product page, just not in the confirmation emails. Here is the code that I've been using..


    Code:
    <mvt:item name="customfields" param="Read_Product_Code( l.settings:product:code, 'docs', g.docs )" />
        <mvt:if expr="NOT ISNULL g.docs">
        <a href="&mvt:product:customfield_values:customfields:docs">Documents</a>
        </mvt:if>
    Thanks!
    Matt E.
    www.harpkit.com
  • ids
    Developer Partner








    • Mar 2006
    • 2171

    #2
    This:

    Code:
     <mvt:item name="customfields" param="Read_Product_Code( l.settings:product:code, 'docs', g.docs )" />     <mvt:if expr="NOT ISNULL g.docs">     <a href="&mvt:product:customfield_values:customfields:docs">Documents</a>     </mvt:if>
    Should probably be this:

    Code:
     <mvt:item name="customfields" param="Read_Product_Code( l.settings:product:code, 'docs', g.docs )" />     <mvt:if expr="NOT ISNULL g.docs">     <a href="&mvte:global:docs">Documents</a>     </mvt:if>
    When you read the 'docs" custom product field, the value gets copied to the Miva global variable you defined called g.docs.

    Scott
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    Comment

    • harpkit
      Mivite



      • Apr 2007
      • 189

      #3
      Hmmm... that didn't work.
      Matt E.
      www.harpkit.com

      Comment

      • ids
        Developer Partner








        • Mar 2006
        • 2171

        #4
        OK, chances are then, your product code doesn't exist in that section.

        1st, make sure the Customfields item is enabled for the email template. The READ_ isn't an API call so the component needs to be enabled.
        2nd, are you using the product code from within the foreach loop that cycles through the order?

        Scott
        Need to offer Shipping Insurance?
        Interactive Design Solutions https://www.myids.net
        MivaMerchant Business Partner | Certified MivaMerchant Web Developer
        Competitive Rates, Custom Modules and Integrations, Store Integration
        AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
        My T-shirt Collection is mostly MivaCon T-shirts!!

        Comment

        • Bruce - PhosphorMedia
          Developer Partner











          • Mar 2006
          • 11257

          #5
          FYI:

          I believe this:
          <mvt:item name="customfields" param="Read_Product_Code( l.settings:product:code, 'docs', g.docs )" /> Should be: <mvt:item name="customfields" param="Read_Product_Code( l.settings:item:code, 'docs', g.docs )" /> As that array uses item not product as the member.
          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

          • harpkit
            Mivite



            • Apr 2007
            • 189

            #6
            Thanks Scott and Bruce! Got it to work.

            Here is the winning code:

            Code:
            <mvt:item name="customfields" param="Read_Product_Code( l.settings:item:code, 'docs', g.docs )" />    
            <mvt:if expr="NOT ISNULL g.docs">    
            <a href="&mvte:global:docs">Documents</a>
            </mvt:if>


            Matt E.
            www.harpkit.com

            Comment

            • AHerb
              Mivite




              • Jun 2017
              • 273

              #7

              Even though it works, seems like you've lost something: ";"
              &mvte:global:docs;

              Comment

              Working...
              X