Announcement

Collapse
No announcement yet.

Capitalise checkout address scripts change

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

    Capitalise checkout address scripts change

    I am using the following script change (inserting uc before lines) to capitalise whatever the user types into the checkout pages. All works perfectly except for the postcode field within the delivery address which is not affected (if you select ship to seperate address, works fine if you are shipping to invoice address)

    Would anyone have any suggestions? Script is OrderScript.pl and the code is below:-


    $::g_ShipContact{'SALUTATION'} = uc $::g_InputHash{'DELIVERSALUTATION'};
    $::g_ShipContact{'NAME'} = uc $::g_InputHash{'DELIVERNAME'};
    $::g_ShipContact{'JOBTITLE'} = uc $::g_InputHash{'DELIVERJOBTITLE'};
    $::g_ShipContact{'COMPANY'} = uc $::g_InputHash{'DELIVERCOMPANY'};
    $::g_ShipContact{'ADDRESS1'} = uc $::g_InputHash{'DELIVERADDRESS1'};
    $::g_ShipContact{'ADDRESS2'} = uc $::g_InputHash{'DELIVERADDRESS2'};
    $::g_ShipContact{'ADDRESS3'} = uc $::g_InputHash{'DELIVERADDRESS3'};
    $::g_ShipContact{'ADDRESS4'} = uc $::g_InputHash{'DELIVERADDRESS4'};
    $::g_ShipContact{'POSTALCODE'} = uc $::g_InputHash{'DELIVERPOSTALCODE'};
    $::g_ShipContact{'COUNTRY'} = uc $::g_InputHash{'DELIVERCOUNTRY'};
    $::g_ShipContact{'PHONE'} = $::g_InputHash{'DELIVERPHONE'};
    $::g_ShipContact{'FAX'} = $::g_InputHash{'DELIVERFAX'};
    $::g_ShipContact{'EMAIL'} = $::g_InputHash{'DELIVEREMAIL'};
    $::g_ShipContact{'USERDEFINED'} = uc $::g_InputHash{'DELIVERUSERDEFINED'};

    Dave
    Cheers

    David
    Located in Edinburgh UK

    http://twitter.com/mcfinster

    #2
    Have you tried:

    $::g_ShipContact{'POSTALCODE'} = uc($::g_InputHash{'DELIVERPOSTALCODE'});

    ie, with uc(...) around brackets?
    http://www.johnsons-seeds.com - Actinic plugins, remote add to cart and custom CMS
    http://www.dtbrownseeds.co.uk - More seeds and plants....
    http://www.mr-fothergills.co.uk - Well it used to be Actinic...

    Comment


      #3
      All I can guess is to search all of OrderScript.pl and put an uc wherever the postal code is referred to.

      It may be that the PC part of Actinic is doing it, like it will do for the country.
      Bob Ladden

      Comment


        #4
        has any one got it to work on the postcode yet?

        the difference being that the post code needs to be all capitals.

        BTW Dave, the script alteration you have entered looks like its only the delivery address not the invoice address was that you intention?
        David

        Comment


          #5
          David,

          I only posted the delivery script change as the invoice changes works perfectly.

          Will try the suggestions in the morning and post the results.

          Dave
          Cheers

          David
          Located in Edinburgh UK

          http://twitter.com/mcfinster

          Comment


            #6
            before I try it, does this capitalise the first letter of an input or capitalise the whole thing?
            David

            Comment


              #7
              uc capitalises everything. If you look on the V6 forum you'll find a post from David N that capitalises the first letter of each word.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Just tried the suggestions and unfortunately none of them work. Adding uc to every instance of DELIVERPOSTALCODE is not advisable, your store will not like it! Adding in () round the code did nothing and I have now tried every combination I can think of.

                I am fairly sure it is the script and not Actinic on the PC itself however so I think it will require someone with considerably more knowledge of perl than I have, which frankly is none! It's a real shame as this would be a great wee addition!

                Dave
                Cheers

                David
                Located in Edinburgh UK

                http://twitter.com/mcfinster

                Comment


                  #9
                  I don't see where the postal code is handled any differently in OrderScript.pl. Check it in the confirmation e-mail. Is is capitalized there?
                  Bob Ladden

                  Comment


                    #10
                    Bob,

                    Receipt comes through with the postcode lowercase too. I have also just tried it with the orderscript.pl in the original folder as I had made changes to the script I was using, it produced the same reuslts.

                    Bit stuck on this one, as you say I cant see where it is handles differently but I guess something in the script is overriding the uc command.

                    Has anyone tried this and got it working?

                    Dave
                    Cheers

                    David
                    Located in Edinburgh UK

                    http://twitter.com/mcfinster

                    Comment


                      #11
                      Normans Jarva script works on that OK

                      can see a really long thread here
                      David

                      Comment


                        #12
                        David,

                        Yeah i saw that thanks, was hoping to do it without the Jarva but I may just use it to save me some time.

                        Cheers

                        Dave
                        Cheers

                        David
                        Located in Edinburgh UK

                        http://twitter.com/mcfinster

                        Comment


                          #13
                          Ok, the postal code gets set in many places. Let's upper it when it's all done.

                          Find this:
                          Code:
                          	#
                          	#
                          	# clean up the input
                          	#
                          	ACTINIC::TrimHashEntries(\%::g_ShipContact);
                          	#
                          	# validate field input
                          	#
                          BEFORE that add this:
                          Code:
                          $::g_ShipContact{'POSTALCODE'} = uc $::g_ShipContact{'POSTALCODE'};
                          $::g_BillContact{'POSTALCODE'} = uc $::g_BillContact{'POSTALCODE'};
                          It's worth a try.
                          Bob Ladden

                          Comment


                            #14
                            Note that I made an edit to the above post soon after I posted it.
                            Bob Ladden

                            Comment


                              #15
                              Bob,

                              Same again I am afraid. Total head scratching going on here!!!

                              Dave
                              Cheers

                              David
                              Located in Edinburgh UK

                              http://twitter.com/mcfinster

                              Comment

                              Working...
                              X