Announcement

Collapse
No announcement yet.

Missing random order confirmation (merchant) emails

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

    #16
    Re: Missing random order confirmation (merchant) emails

    Originally posted by Brennan View Post
    So you may just be missing the output of the variable to the page:

    &mvte:global:newsletter;
    Thanks, Brennan. I was missing the output variable! Doh! But that format doesn't work for me.

    I was able to get the output to appear on the Printable Invoice using this code:

    Code:
    &mvte:customfields:newsletter;
    So, that's fine now.

    Now, I am trying to get a customer "text-area" custom field type working, but instead of the words I am entering in the field, the system is only recording a "0" in the custom field tab.

    Here's my code on OCST:

    Code:
    <textarea name="customer-comments" wrap="soft" cols="80" rows="5">&mvte:global:customer-comments;</textarea>
    Here's my code on OSEL:

    Code:
    <mvt:item name="customfields" param="Write_Basket('customer-comments', g.customer-comments)" />
    Here's my code on Printable Invoice template:

    Code:
    <mvt:item name="customfields" param="Read_Order(l.settings:order:id, 'customer-comments')" />
    &mvte:customfields:customer-comments;
    Last edited by skepticwebguy; 04-18-14, 11:02 AM.

    Comment


      #17
      Re: Missing random order confirmation (merchant) emails

      Any idea why this code is writing a "0" entry in my customer comments custom field instead of writing the email address being typed into the text area?

      Code:
      <textarea name="customer-comments" wrap="soft" cols="80" rows="5">&mvte:global:customer-comments;</textarea>
      Yet this code for a text field works fine to write an email address to the custom field:

      Code:
      <input type="text" id="newsletter" name="newsletter" size="50" />
      Last edited by skepticwebguy; 04-18-14, 12:27 PM.

      Comment


        #18
        Re: Missing random order confirmation (merchant) emails

        Maybe the issue is that I cannot have two custom fields on the same page. Is that the problem?

        I'm trying to collect data in a 1) text field AND 2) a text area on the OCST page: one for customer comments and one for newsletter email signups, as follows:

        Code:
        <h5> Customer Comments </h5>
        <textarea id="customer-comments" name="customer-comments" wrap="soft" cols="80" rows="5"></textarea> 
        
        <h5> Get our Newsletter </h5>
        <input type="text" id="newsletter" name="newsletter" size="50" />
        On my OSEL page I have these TWO Write_Baskets to record the data that was entered on OCST:

        Code:
        <mvt:item name="customfields" param="Write_Basket('newsletter', g.newsletter)" />
        <mvt:item name="customfields" param="Write_Basket('customer-comments', g.customer-comments)" /
        When I run a test order, the email address I enter into the newsletter text field gets written to the custom field perfectly. However, the customer comment I entered on my test order gets written to the customer comment field as a "0".

        Why would that be?

        Can I not use Write_Basket to write both the input from a text field AND the input from a text area?

        Comment


          #19
          Re: Missing random order confirmation (merchant) emails

          Originally posted by skepticwebguy View Post

          When I run a test order, the email address I enter into the newsletter text field gets written to the custom field perfectly. However, the customer comment I entered on my test order gets written to the customer comment field as a "0".

          Why would that be?

          Can I not use Write_Basket to write both the input from a text field AND the input from a text area?
          Solution: I changed the custom field code from a hyphenated "customer-comments" to a single word "custmrcmts" and, voila! It works! I can now use a text field and a different text area on the same page without it generating a "0" value.

          Who knew a hyphenated custom field code could wreak so much havoc?

          Comment


            #20
            Re: Missing random order confirmation (merchant) emails

            Interesting. I will check with development, because as far as I know you should be able to use hyphenated variables. Glad you got it working though.

            I'll let you know what I hear back from development.
            Brennan Heyde
            VP Product
            Miva, Inc.
            [email protected]
            https://www.miva.com

            Comment


              #21
              Re: Missing random order confirmation (merchant) emails

              I just spoke with our development team on this.

              Hyphens in global variable names will not work with any of the custom field functions.

              Take this code for example:

              Code:
              <mvt:item name="customfields" param="Write_Basket('customer-comments', g.customer-comments)" />
              The g.customer-comments is a valid global variable, however in that context, the custom fields function is going to try to evaluate it as an expression so what it sees is the dash becomes a subtraction sign:

              g.customer - g.comments

              It is treating it as a math expression which is why you were getting 0.

              There is no way around this other than to implement the practice of no using dashes in your custom field names so you don't run into this issue.
              Brennan Heyde
              VP Product
              Miva, Inc.
              [email protected]
              https://www.miva.com

              Comment

              Working...
              X