Announcement

Collapse
No announcement yet.

Adding "Order Instructions" Custom Field Data To Confirmation Email Template

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

    Adding "Order Instructions" Custom Field Data To Confirmation Email Template

    Hello I am hoping to make the "order_instructions" custom field display in the confirmation email template (Order Confirmation: Merchant), since it's very hard to notice the customers' comments right now.

    Under OSEL I found:
    Code:
    <mvt:if expr="g.Previous_Screen EQ 'OSEL'">
    <mvt:item name="customfields" param="Write_Basket('order_instructions', g.order_instructions)" />
    <mvt:else>
    <mvt:item name="customfields" param="Read_Basket('order_instructions', g.order_instructions)" />
    </mvt:if>
    textarea name="order_instructions" rows="6" class="input">&mvte:global:order_instructions;</textarea>

    And I was wondering if anyone could direct me how I would output that data into the email template. I thought about just selecting the custom field under order contents, but something tells me that isn't going work...
    Thanks

    EDIT I think I may have also posted this in the wrong forum, sorry
    Attached Files

    #2
    Try
    <mvt:item name="customfields" param="Read_Order(l.settings:order:id,'order_instructions')" />
    <mvt:if expr="NOT ISNULL l.settings:customfields:order_instructions">
    <div>
    Instructions:: &mvt:customfields;
    </div>

    We use something like this in our merchant confirmation email
    Last edited by wajake41; 08-07-18, 02:14 PM.
    Larry
    Luce Kanun Web Design
    www.facebook.com/wajake41
    www.plus.google.com/116415026668025242914/posts?hl=en


    Comment


      #3
      Your confirmation email template can be edited by navigating to Order Fulfillment Settings -> Order Confirmation: Customer. If the information in your Order Instructions is going to be the same for every order, there's no need to mess with custom fields at all. You can just add the appropriate HTML wherever you'd like in the template. Just a heads up - layout for an email can be very tricky since it relies heavily on table elements and other arcane rules - you'll definitely want to test it a bit to make sure it's what you want. Copy and paste the email template and enter it into a live HTML editor like codepen or jsfiddle and tweak it there (rather than editing, saving, placing an order, waiting for the email, etc., which you can start doing when you feel confident with how it looks in live editor).

      Comment


        #4
        I just did this now based on wajake41's code - worked great! Here is what mine looks like

        Code:
        <p style="font-weight: bold;">Order instructions from &mvte:order:bill_fname;</p>
        <p>
        <mvt:item name="customfields" param="Read_Order(l.settings:order:id,'order_instructions')" />
        <mvt:if expr="NOT ISNULL l.settings:customfields:order_instructions">
        &mvt:customfields;
        </mvt:if>
        
        </p>
        Dylan Buchfink
        The Mattress & Sleep Company
        http://www.tmasc.ca/

        Comment


          #5
          I am having issues getting this custom field to work. I think I've narrowed it down to different types of order items that can be assigned to the page. I have a levels ready theme. Here's how it goes for this custom field to display:

          INVC - Does not show Order Instructions. Items: order and order_contents items.
          ORDP - shows Order Instructions. Items: view_order and order items.
          ORDS - shows Order Instructions. Items: view_order and order items.
          Order Confirmation / Merchant - Does not show Order Instructions. - Items: order and toe_order_contents
          Order Confirmation / Customer - Does not show Order Instructions. - Items: order and toe_order_contents

          So, it must be view_order item that has to be assigned to get it to work? Why wouldn't it work with the order_contents, or toe_order_contents?

          Jamie
          Jamie Donaldson
          JSDVS Web Design / Development
          Web Design | Web Development | E-commerce Design & Integration

          Comment


            #6
            Originally posted by jsdva View Post
            I am having issues getting this custom field to work. I think I've narrowed it down to different types of order items that can be assigned to the page. I have a levels ready theme. Here's how it goes for this custom field to display:

            INVC - Does not show Order Instructions. Items: order and order_contents items.
            ORDP - shows Order Instructions. Items: view_order and order items.
            ORDS - shows Order Instructions. Items: view_order and order items.
            Order Confirmation / Merchant - Does not show Order Instructions. - Items: order and toe_order_contents
            Order Confirmation / Customer - Does not show Order Instructions. - Items: order and toe_order_contents

            So, it must be view_order item that has to be assigned to get it to work? Why wouldn't it work with the order_contents, or toe_order_contents?

            Jamie
            Jamie, I feel your pain. I had posted a request on how to convert from the EmporiumPlus Addendum module to the built in custom fields, but didn't really get anywhere (but you know that)

            https://www.miva.com/forums/forum/on...ddendum-module
            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


              #7
              Lol. I know Leslie...all too well! I've fought Custom Order Fields, Addendum and Purchase Order Plus until I have keyboard dents in my forehead from banging my head!

              Sometimes the love just does not come! [sigh]

              Jamie
              Jamie Donaldson
              JSDVS Web Design / Development
              Web Design | Web Development | E-commerce Design & Integration

              Comment


                #8
                Just cut to the chase and pull the custom fields in manually using the SMT Read_xxxxx() functions. That way you also get more readable variables.
                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


                  #9
                  Originally posted by Bruce - PhosphorMedia View Post
                  Just cut to the chase and pull the custom fields in manually using the SMT Read_xxxxx() functions. That way you also get more readable variables.
                  Well...I'll see what I can figure out to do that. Thanks Bruce@!
                  Jamie Donaldson
                  JSDVS Web Design / Development
                  Web Design | Web Development | E-commerce Design & Integration

                  Comment


                    #10
                    It would be really, really cool if some detailed examples of these would be created. Something like what Bill used to do, with examples of how to place them on each page as needed. If they could be "compartmentalized" into ReadyTheme content sections that could then have tokens inserted where needed (like Bill's Addendum). It would really help so many of get moved from the Addendum.
                    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


                      #11
                      What would also be cool is for Miva to "fix" the auto conversion of basket fields to order fields. (This is where, if you have a custom order field called "Order_Notes", and write that customer input into a Custom Basket Field called "Order_Notes", that data is automatically converted into its same named Custom Order field.) The problem is, this doesn't work MOST of the time to capture data on OPAY for Templated Fulfillment Emails. I assume that this is because the Custom Fields module runs AFTER the Templated Email module functions.
                      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


                        #12
                        Sort of a sidebar question to that Bruce, is it or would it be possible to collect additional data at the BASK screen? For example, a customer may want to request something to be added to the order would it be possible to do this at the BASK screen?
                        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