Announcement

Collapse
No announcement yet.

Displaying choices on separate lines in the cart

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

    Displaying choices on separate lines in the cart

    I have followed the instructions in the Knowledge Base article to display choices on separate lines in the cart How do I display choices on separate lines in the cart?, but although it works I also get a <br/> tag amended to the choice name in the Actinic Order System and also in the customers email (see attached images).

    Has anybody managed to get this to work without the unwanted <br/> tags appearing or any ideas how the code should be amended to work correctly.

    Although it is in the Knowledge Base I couldn't find it in the V9 AUG.

    I found this old thread which relates to older versions: Listing attributes in a column
    Attached Files
    Last edited by KB2; 22-Mar-2010, 02:50 PM. Reason: Updating kb links
    Darren Guppy
    Golf Tee Warehouse
    Golf Tees and Golf Accessories.

    #2
    I have now tried adding the <br/> tag inside !!< >!!, but as I thought does not work.
    Darren Guppy
    Golf Tee Warehouse
    Golf Tees and Golf Accessories.

    Comment


      #3
      I haven't looked into this but I think you'll have to see if you can style it rather than add <br>s.
      Might get a bit more juicy to achieve though.

      Comment


        #4
        I think the display of choices in the cart is controlled by the actinic scripts so styling it is probably beyond me.
        Darren Guppy
        Golf Tee Warehouse
        Golf Tees and Golf Accessories.

        Comment


          #5
          I think your simplest 'solution' with this is to only make the mod to ActinicOrder.pm for the cart, but not to OrderScript.pl. I expect you can live with the <br />s in the order screen.

          At least then it will look as you want it in the cart.

          If you want to attempt the OrderScript.pl as well then...

          I can't see how the email mod could ever work as it is as the email is text not html anyway. Iwould've expected it to be something like:
          $sName =~ s/\r\n/g; or $sName =~ s//\r\n/g;

          Note I say 'something like' because my knowledge of perl is not good, so you probably have to play around with it a bit.

          Comment


            #6
            Thanks Norman I will play around with it when I get time.

            I have tried not applying the 'OrderScript.pl' mod but the <br/> is still displayed.
            I also agree that the 'Orderscript.pl' change doesn't seem to work. Initially I thought it was doing something but on second inspection I can see the line breaks are purely the natural line break positions.

            I have no experience of Perl so I think I will have to give the idea up.
            Darren Guppy
            Golf Tee Warehouse
            Golf Tees and Golf Accessories.

            Comment


              #7
              Give this a go...

              In OrderScript.pl try just stripping the <br /> like this...

              for <br />:
              $sName =~ s/<br \/>/\r\n/g;

              or for <br>:
              $sName =~ s/<br>/\r\n/g;

              or for <br/>:
              $sName =~ s/<br\/>/\r\n/g;

              depending how you have your breaks

              EDIT: or if the < and > need escaping (I don't think so) then....

              for <br />:
              $sName =~ s/\<br \/\>/\r\n/g;

              or for <br>:
              $sName =~ s/\<br\>/\r\n/g;

              or for <br/>:
              $sName =~ s/\<br\/\>/\r\n/g;

              Comment


                #8
                Duncan to the rescue yet again. (I very nearly called you Norman again), although I haven't yet tried the exact code you gave as everytime I looked you had modified it slightly in an 'EDIT'

                A typo in the Knowledge Base article is to blame.
                It tells you use
                Code:
                my $separator = shift || '<br/>';
                in 'ActinicOrder.pm'
                and add
                Code:
                $sName =~ s/(\<br\>)/\r\n/g;
                into 'OrderScript.pl'.

                One solution is to change <br/> to <br> in 'ActinicOrder.pm'
                the other option is to use $sName =~ s/(\<br\/>)/\r\n/g; in 'OrderScript.pl'

                I almost solved it myself earlier after noticing <br/> in one and <br\> in the other, but I tried changing the second one to <br/> to match which then broke the checkout script.

                I must read up on 'escaping'

                THANKS
                Darren Guppy
                Golf Tee Warehouse
                Golf Tees and Golf Accessories.

                Comment


                  #9
                  I can also confirm that your suggestion:

                  Code:
                  for <br/>:
                  $sName =~ s/<br\/>/\r\n/g;
                  also works.

                  The only minor annoyance is that <br> is still displayed on the Order Screen, but I can live with that.
                  Darren Guppy
                  Golf Tee Warehouse
                  Golf Tees and Golf Accessories.

                  Comment


                    #10
                    So to sum for anyone else wanting to do this.

                    The Knowledgebase article How do I display choices on separate lines in the cart? shows the following...

                    in 'ActinicOrder.pm' replace
                    Code:
                    my $separator = shift || ',';
                    with
                    Code:
                    my $separator = shift || '<br/>';
                    and in 'OrderScript.pl' find:
                    Code:
                    $sName =~ s/(!!\<|\>!!)//g;
                    add the following on a new line directly above this code:
                    Code:
                    $sName =~ s/(\<br\>)/\r\n/g;

                    This wrong it should be:

                    ....
                    and in 'OrderScript.pl' find:
                    Code:
                    $sName =~ s/(!!\<|\>!!)//g;
                    add the following on a new line directly above this code:
                    Code:
                    $sName =~ s/(\<br\/>)/\r\n/g;
                    EDIT: corrected per the post below.
                    Last edited by KB2; 22-Mar-2010, 02:49 PM. Reason: Updating kb links

                    Comment


                      #11
                      Not quite

                      Code:
                      $sName =~ s/(\<br\/>)/\r\n/g;
                      should be added above and NOT replace
                      Code:
                      $sName =~ s/(!!\<|\>!!)//g;
                      I had misread the instructions myself and replaced the code instead of adding it above which I thought may initially have been the problem.
                      Darren Guppy
                      Golf Tee Warehouse
                      Golf Tees and Golf Accessories.

                      Comment


                        #12
                        True - I've corrected my post above.

                        Comment


                          #13
                          Thanks Duncan, Darren. The KB article has now been amended.
                          Ben Popplestone
                          Ecommerce website software

                          Comment


                            #14
                            Sorry to reopen this thread, but I am in final testing of my site before going live with the relaunch from V7 to V9 and have now realised that although the KB article does what it should it still leaves the <br/> tag on the order screen which I can live with but this tag is also then displayed on the customers invoice which is not ideal.

                            Any ideas how this might be solved.
                            Darren Guppy
                            Golf Tee Warehouse
                            Golf Tees and Golf Accessories.

                            Comment


                              #15
                              It should be possible to modify the invoice to remove "<br/>" if found on the invoice. You would need Crystal Reports 8.5 and a working knowledge of it to make the change.

                              Comment

                              Working...
                              X