Announcement

Collapse
No announcement yet.

Linefeeds showing in Other Info box in Cart, Checkout and Emails

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

    Linefeeds showing in Other Info box in Cart, Checkout and Emails

    Hello there,

    I would appreciate some assistance if anyone has any idea how to deal with this. Have searched and no-one else seems to have had this problem, so maybe not.

    We make use of the "Making the Other Info Box Optional" and the "Having a larger box for the 'Other Info' Prompt" script changes from the AUG.

    Since updating to Sellerdeck 2013 we have started getting extraneous linefeed characters - %0a - in our cart, checkout and related mails where there's a new line, but not when we print out the order forms. I believe we may have had this problem before in a previous version, but someone else was looking after the website at the time and I can't find any notes dealing with the matter. If it was extra <BR> tags that would tell us that the scripts hadn't been copied in properly; but it isn't, and I've checked and re-checked everything many times over.

    Some screenshots:

    Entering into the Other Info Prompt -


    How it appears in the Cart:


    How it appears in the Checkout:


    The website in question:
    http://www.classyglass.co.uk

    If anyone has any ideas I'd be most grateful!

    #2
    Nobody else encountered this problem?

    Comment


      #3
      Solution

      Surprisingly Sellerdeck Support seemed to have part of an answer for this, asked them on the off-chance whilst sorting something else.

      This is what I got from them:

      In ActinicOrder.pm find and replace:


      $sValue = ACTINIC::HTMLEncode($sValue);
      if ($bStatic)
      { $sHTML = $sValue; }
      else
      {


      WITH THIS


      #$sValue = ACTINIC::HTMLEncode($sValue);
      if ($bStatic) { $sHTML = $sValue; }
      else
      {
      $sValue = ACTINIC::HTMLEncode($sValue);
      However, although this fixed the issue in the Checkout area and the customer e-mails, the extraneous linefeed characters were still appearing in View Cart.

      Fed up of dozens of emails and phone calls a week from panicking customers thinking we were going to engrave %0a on everything, I managed to hack together this solution. No doubt there is a more elegant way of doing this, but I needed to get the damn thing fixed.


      Go into Design|Text|Web Site|HTML|Other Info Text Field and replace the contents with the following:

      %s<textarea name="%s" class="replaceme" rows="5" cols="40" %d maxlength="%d" readonly>%s</textarea>
      This will also prevent the customer from editing the contents of the textarea whilst they are in the checkout. We do this because we charge for engraving and so allowing customers to alter their Other Info causes problems. If this isn't a problem for you and you wish to retain an editable textarea simply delete "readonly" from the above.

      Next you need to go into the View Cart Page Shopping Cart Grid layout. Clicking on the shopping cart grid area in Design panel for your shopping cart should get you to this. Add the following to the bottom of this layout:

      <actinic:block if="%3cactinic%3avariable%20name%3d%22IsNotPreviewMode%22%20%2f%3e">
      <script type="text/javascript">
      function replaceNewLine(myString) {
      return myString.replace(/%0a/gi,'');
      }

      function getElementsByClass(searchClass,node,tag) {
      var classElements = new Array();
      if ( node == null )
      node = document;
      if ( tag == null )
      tag = '*';
      var els = node.getElementsByTagName(tag);
      var elsLen = els.length;
      var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
      for (i = 0, j = 0; i < elsLen; i++) {
      if ( pattern.test(els[i].className) ) {
      classElements[j] = els[i];
      j++;
      }
      }
      return classElements;
      }

      function transformInformation() {
      var elements = getElementsByClass("replaceme");
      for (i = 0; i < elements.length; i++) {
      var element = elements[i];
      element.innerHTML = replaceNewLine(element.innerHTML);
      }
      }
      transformInformation();
      </script>
      </actinic:block>

      Hopefully if anyone else gets this problem, the above will be of some use to them.


      EDIT: It turns out that the javascript I originally posted drastically slows down Sellerdeck (it really is a very severe effect). Not entirely sure why, as the scripts are only called in the shopping cart. I have edited the above to add an IsNotPreviewMode block in order to counter this and you should now experience no problems.

      Comment


        #4
        PLEASE HELP: Site Backups Failing after Making this change

        Hi. I just started using the multi line solution for other information. Having got the extra characters I put in the changes detailed in the post. It all looked like it worked fine (example: http://www.secretgardenquilting.co.u...oucher-10.html) .

        I did a site backup and restore to a different PC to check the site backup worked and I got the following fatal error:

        FATAL ERRORS
        (File ExportFiles.cpp, Line 170) - Archive error 13 - Extract selected files call failed
        Library error - ChilkatLog:
        GetEntryByName:
        DllDate: Oct 28 2013
        ChilkatVersion: 9.4.1.68
        UnlockPrefix: SELLERZIP
        Username: TONY-PC:Tony
        Architecture: Little Endian; 32-bit
        Language: Visual C++ 8.0
        VerboseLogging: 0
        entryToFind: ./CATALOG_SITE/ActinicCatalog.mdb
        caseSensitive: 0
        Found entry and returning ZipEntry object...
        --GetEntryByName
        --ChilkatLog
        has been caught.

        I have done many back ups (prior to putting in this code) and they restored fine.

        I am very worried about not having a working backup and the possibility of unknown impact on the live site. I would really appreciate some help to resolve it.

        Many thanks
        Tony
        www.secretgardenquilting.co.uk

        Comment


          #5
          Try searching the forum for "ChilkatLog". Others experiencing this error have found it's due to having online backup running among other things.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Norman. Thank you for the pointer. Sorry about the delay in responding. I have been going through the posts and trying to solve but I have made no progress. I switched off the network to see if something was conflicting with the online backup but it did not help.

            I guess the first issue I have is that I cant understand what the error message means it looks like it says it can find a function called GetEntryByName. Any additional pointers on how to read the error message would be gratefully received?

            Should I post this as a new thread to see if anyone else has the issue or ideas on how to resolve it?

            Many thanks

            Tony
            Tony
            www.secretgardenquilting.co.uk

            Comment


              #7
              Hi. Just to close out this thread on the error message. Sellerdeck Support came back to me on the issue. I didn't get an explanation of what the error message meant. However they suggested I compact my DB. After doing this a couple of times it actually sorted out the issue. Big relief! Thank you everyone for your help and ideas. Tony
              Tony
              www.secretgardenquilting.co.uk

              Comment


                #8
                Just a heads up, it would seem this workaround no longer works in Sellerdeck 2014.

                Comment

                Working...
                X