Announcement

Collapse
No announcement yet.

Custom Customer Fields on ACAD & ACED

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

    Custom Customer Fields on ACAD & ACED

    Hello All,

    I'm tackling the need to write some custom customer fields for ACAD and ACED but nothing seems to work. The videos on this topic tend to focus on Product and Order custom fields usage but not much to do with Customer custom fields.

    1. Here's my most recent iteration of code on ACAD and ACED, and it works on neither page.

    HTML Code:
                <mvt:item name="customfields" param="Write_Customer_ID( l.settings:customer:id, 'middle_name', g.middle_name )" />
                <label class="required" for="middle_name">Middle Name:</label>
                <input type="text" name="middle_name" id="middle_name" value="&mvte:global:middle_name;" class="textfield" />
    Have tried various combinations of code, to no avail. Does anybody have a tried-and-true code block?


    2. Am also trying to have confirmed customers upload a registration card image to their record. Has anybody had any success with this without using a module?


    Thanks,
    Michael

    #2
    You're code looks fine. Where is this code located. Write_Customer_ID function needs to be on the page that ACAD submits to. This is where the input value will be available as a global value and you can save it.

    If you just have that function on ACAD the value of g.middle_name is not set yet so you're overwriting your custom customer field with a value of '' each time the page loads.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Hi Brennan,

      1. OK, I have it writing to ACED and it populates well. Problem arises when ACED is accessed NOT from ACAD but from "Update Account Information" on ACLN and fields go blank. I guess I need to write some conditionals in this case but how can the one page read the field (if it already exists) whilst still being able to write to the custom field if the customer needs to change the information. Sorry - brain blocked here!

      2. I am also trying to have confirmed customers upload a registration card image to their record. Has anybody had any success with this without using a module?

      3. I've seen it written here a few times: The need to make a custom field "required" and the answer back is usually to use a script BUT I was wondering is there anything on the radar to make this native, like other regular customer fields?

      Thanks again,
      Michael

      Comment


        #4
        1. Wrap your Write_Customer_ID call in an if statement that checks for the ICST action. This way it only runs if the customer has submitted the account create form. Otherwise it gets skipped

        2. We typically handle this via a php upload script to allow us to upload files to the server. Just make sure you're taking precautions such as limiting the file type, size and location the file is saved. It possible it is best to upload it to a external server or CDN so it is not going on the same server as Miva.

        3. Yes we talked about this before. Nothing is in development yet but I can see us adding the ability to have Miva track required custom fields and handle the validation.
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment


          #5
          Thanks Brennan. I'll do what you describe in (1). Thanks for the other info.

          cheers,
          Michael

          Comment


            #6
            now what if we need to make it a required custom customer field on signup ... and not let them create an account unless they provide the required information.
            In other words if the custom customer field is blank, how to make it required?

            Comment


              #7
              I haven't tried it yet, but I stumbled over this post a few days ago. It might be what you are looking for.

              http://www.miva.com/forums/forum/onl...ields-question

              See the comments way down the thread by Alphabet about creating a PREACTION page. Basically, on page submit you are redirecting to an intermediate page for validation. If it passes, you get to continue on to the intended page. If it fails, then you setup an error message and you are stuck on the original page until you meet the validation requirements. In your case, did they provide the custom field information or not.


              If that's too complicated, maybe you can google and find a script to help you out. I do know that the html tag "required" only works in some browsers, so you really shouldn't rely on that.

              Sorry, I don't have a firm answer for you. I'm in the middle of a project and way behind the deadline.
              Shannon Wright
              Xact Xpressions, Inc.

              Comment


                #8
                i was hoping to validate without using an older module.
                I wish there was a way to get to the ICST action,
                so I could do something like

                if custom_customer_field_bizname is blank
                set biz_name_invalid
                go back to ACAD page
                else
                write custom_customer_field_bizname
                endif

                if there were an ability to stop icst from completing going forward to aced
                then we could really test for if a custom customer field was filled in (and we could validate it)

                Comment


                  #9
                  As Shannon says, a pre-action is about the only way to take control between the processing of Action codes and the rendering of a page. The other possibility, of course, is to use Javascript on the account page to validate things before the page is submitted.

                  At least one of the "Tool" modules has the pre-action feature; sorry, I don't recall which one. I also have a utility module that does pre-actions, as well as post-actions, pre-screens, and post-screens, which are sometimes helpful.

                  Kent Multer
                  Magic Metal Productions
                  http://TheMagicM.com
                  * Web developer/designer
                  * E-commerce and Miva
                  * Author, The Official Miva Web Scripting Book -- available on-line:
                  http://www.amazon.com/exec/obidos/IS...icmetalproducA

                  Comment


                    #10
                    Why not just use javascript or jQuery validation?
                    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


                      #11
                      what if they have javascript turned off? can they still use miva 9?

                      also.. could toolkit system action do this?

                      Comment


                        #12
                        If there is still someone on the web with Javascript turned off...they are not really going to be your customer. Its considered better UX experiance to validate before submitting (esp. mobile) so there's that benefit too.
                        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


                          #13
                          well, i usually am one with it turned off. lol. Amazon still works with it turned off. so do my other sites. I believe things need to fall back if something is broken like when a cdn that serves fonts or jquery isn't working. and it does happen.

                          Comment


                            #14
                            well, i usually am one with it turned off. lol. Amazon still works with it turned off. so do my other sites. I believe things need to fall back if something is broken like when a cdn that serves fonts or jquery isn't working. and it does happen. this form fails when it is turned off though :-(

                            Comment


                              #15
                              well, i usually am one with it turned off. lol.
                              Amazon still works with it turned off. so do my other sites. I believe things need to fall back if something is broken like when a cdn that serves fonts or jquery isn't working. and it does happen.

                              Though this forum fails when it is turned off. ... as the editing resulted in multiple posts instead of edits of the original.

                              Comment

                              Working...
                              X