Adding New Fields (ToolKit) and Making Them Required

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

    • May 2006
    • 157

    #1

    Adding New Fields (ToolKit) and Making Them Required

    Using Toolkit and MIVAs custom customer fields, I've successfully added fields into the ACAD form. I now need to require that some of these new fields have a value entered. Here's an example asking for a user's Resale Number:

    Code:
    <label class="required" for="resale-number">Resale Number:</label>
    <input type="text" name="resale-number" id="resale-number" value="&mvte:global:resale-number;" class="textfield" />
    Using the ToolKit function "systemaction" I'm trying to require this field. I've added the following just below my code for the custom field:

    Code:
    <mvt:item name="toolkit" param="systemaction|resale-number|ACAD|A Resale Number is Required." />
    I've also created a template called ACAD_SYSTEM, activated the Toolkit item and pasted the following into this new page template:

    Code:
    <mvt:if expr="resale-number EQ ''">
    <mvt:item name="toolkit" param="mvassign|tkmessage|encodeentities(g.tkmessage)" />
    <mvt:item name="toolkit" param="mvassign|tkscreen|encodeentities(g.tkscreen)" />
    <mvt:item name="toolkit" param="vacreate|error_message|g.tkmessage|," />
    <mvt:item name="toolkit" param="sassign|Error_Message_Count|1" />
    <mvt:item name="toolkit" param="vassign|Error_Messages|l.all_settings:error_message" />
    <mvt:item name="toolkit" param="vassign|Screen|g.tkscreen" />
    </mvt:if>
    <mvt:exit>
    It's not working. All of the MIVA fields are outlining in red to show that they are required, but I don't see the error message
  • PCINET - Andreas
    Developer Partner




    • Mar 2006
    • 2439

    #2
    Re: Adding New Fields (ToolKit) and Making Them Required

    Why don't you use ACAD's module settings to make it required?
    Andreas Toman
    PCINET, LLC

    Miva Merchant Design, Development, Integration & Support
    We built over 200 Miva Merchant stores!
    Miva shopping cart design & integration service and see our Portfolio!


    e-mail: [email protected]
    web: www.pcinet.com
    LinkedIn: Andreas Toman
    phone: (786) 250-2056 (Miami, FL)

    Comment

    • pixeljuice
      Mivite

      • May 2006
      • 157

      #3
      Re: Adding New Fields (ToolKit) and Making Them Required

      Hi
      Andreas,

      That would be ideal. Is there a published article that would allow me to learn to do that?

      Timothy

      Comment

      • PCINET - Andreas
        Developer Partner




        • Mar 2006
        • 2439

        #4
        Re: Adding New Fields (ToolKit) and Making Them Required

        Timothy, Sebenza's ACAD module comes with doc and has a link to the docs in the module settings. This should be what you are looking for.
        Andreas Toman
        PCINET, LLC

        Miva Merchant Design, Development, Integration & Support
        We built over 200 Miva Merchant stores!
        Miva shopping cart design & integration service and see our Portfolio!


        e-mail: [email protected]
        web: www.pcinet.com
        LinkedIn: Andreas Toman
        phone: (786) 250-2056 (Miami, FL)

        Comment

        • pixeljuice
          Mivite

          • May 2006
          • 157

          #5
          Re: Adding New Fields (ToolKit) and Making Them Required

          Thanks for the info. I'll check it out, but wonder if I'll be able to make sections within this as I've done with ToolKit.

          ChromeScreenShot.jpg

          Timothy

          Comment

          • pixeljuice
            Mivite

            • May 2006
            • 157

            #6
            Re: Adding New Fields (ToolKit) and Making Them Required

            Just checked and Sebenza doesn't seem to have an ACAD module. Were you thinking I could use the Additional Data Collection at Checkout module on the ACAD page?

            Comment

            • PCINET - Andreas
              Developer Partner




              • Mar 2006
              • 2439

              #7
              Re: Adding New Fields (ToolKit) and Making Them Required

              Oops, I was under the impression you are using Sebenza's additional checkout data module to collect additional checkout data. You are actually trying to collect customer data when they create an account.
              Looking at your code, it looks like you missed a step in Bill's docs to get the error message.
              Andreas Toman
              PCINET, LLC

              Miva Merchant Design, Development, Integration & Support
              We built over 200 Miva Merchant stores!
              Miva shopping cart design & integration service and see our Portfolio!


              e-mail: [email protected]
              web: www.pcinet.com
              LinkedIn: Andreas Toman
              phone: (786) 250-2056 (Miami, FL)

              Comment

              • pixeljuice
                Mivite

                • May 2006
                • 157

                #8
                Re: Adding New Fields (ToolKit) and Making Them Required

                Don't see that I missed anything, unless something is required to create the "action" Bill refers to as the 2nd parameter.

                Code:
                <mvt:item name="toolkit" param="systemaction|SHIP|OSEL|Please select a different shipping method" />
                The 2nd parameter is the "action" to check. In this example we are going to check for a shipping method being selected. If the customer does not select a method, we are going to reload the page identified with the 3rd parameter. The 4th parameter is the message. No html allowed in the message.

                Comment

                • PCINET - Andreas
                  Developer Partner




                  • Mar 2006
                  • 2439

                  #9
                  Re: Adding New Fields (ToolKit) and Making Them Required

                  Try to contact Bill. he is usually around and helps on the forum if it is about toolkit or related items.
                  Andreas Toman
                  PCINET, LLC

                  Miva Merchant Design, Development, Integration & Support
                  We built over 200 Miva Merchant stores!
                  Miva shopping cart design & integration service and see our Portfolio!


                  e-mail: [email protected]
                  web: www.pcinet.com
                  LinkedIn: Andreas Toman
                  phone: (786) 250-2056 (Miami, FL)

                  Comment

                  • nottheusual1
                    Mega Mivite


                    • Jul 2008
                    • 1124

                    #10
                    Re: Adding New Fields (ToolKit) and Making Them Required

                    For some reason it sticks in my mind that the dash in your custom field code may be causing the problem. Replace it with an underscore and see if things work better.

                    Comment

                    • pixeljuice
                      Mivite

                      • May 2006
                      • 157

                      #11
                      Re: Adding New Fields (ToolKit) and Making Them Required

                      Originally posted by nottheusual1 View Post
                      For some reason it sticks in my mind that the dash in your custom field code may be causing the problem. Replace it with an underscore and see if things work better.
                      Given that I've already collected data using "resale-number" with the dash in my custom field code, do I run the risk of losing all of that customer data by changing the existing code to resale_number? Or, is this field actually assigned an ID in the database and I'll still be able to see all the Resale Number entries if I do make this change?

                      Timothy

                      Comment

                      • wcw
                        Developer Partner

                        • Mar 2006
                        • 11329

                        #12
                        Re: Adding New Fields (ToolKit) and Making Them Required

                        The data is actually kept in a record that tracks by ID number. So changing the code or name won't lose the data. However, if you have coded some page templates to look for resale-number, you'll need to go back and change the - to _.
                        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

                        • nottheusual1
                          Mega Mivite


                          • Jul 2008
                          • 1124

                          #13
                          Re: Adding New Fields (ToolKit) and Making Them Required

                          Modifying the field code won't bother anything unless you've hard-coded it into a template somewhere. The reason it sticks in my mind is that, as a practice, we don't use dashes in naming anything Miva-specific and I remember having problems sometimes when we did.

                          Hope it makes the difference. Easy fixes are good.

                          Comment

                          Working...
                          X