Announcement

Collapse
No announcement yet.

attribute <br> in actinicorder.pm

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

    attribute <br> in actinicorder.pm

    I have 1 product with 1 component and about 9 attributes....when they are in the cart i want the attributes to be displayed on sepperate lines as if they were sepperate items....now i managed this by inserting a <br> tag in my actinicorder.pm file here...

    $Res{text} .= $pAttribute->[$::ABIDX_NAME] . ': ' . $pAttribute->[$::ABIDX_CHOICES]->[$nIndex] . $separator . ' <br>'; # Choice description

    but in my reports, invoices etc...it shows the <br> tag as text and displays them all as 1 line...which looks ugly...

    here are 2 images of my cart and my order screen.
    http://s172585708.websitehome.co.uk/cart.gif
    http://s172585708.websitehome.co.uk/contents.gif

    plzz help me nice people.

    #2
    Hi Steven,

    Not sure if this can be done, but will check with development and get back to you.
    Kind Regards,

    Seeths
    SellerDeck

    Comment


      #3
      thx for reply

      thx for replying....i always worry cos no1 ever seems to be able to answer my queeries ;0)

      im not a perl programmer so dont know what html you can use but i dont see why it should be displaying it in my reprts as plain text.

      also thx for your reply on my other post....i now have all my choices on 1 component....so i have about 9 attributes and 1 component....

      i have set up my permutations ok for the prices as they are only dependent on which coursde they chose so i have about 30 or so....

      but there are only 6 places available for each course date so i tried to set up a hidden product for each date....but as i mentioned it doesnt seem to aloow 2 permutations on 1 order.

      the only problems i realy have now is the stock problem....because obviously i want to reduce the stock level for each date.

      so reduce multiple stock levels from one order...is that possible or can only 1 product stock level be reduced per order?

      Comment


        #4
        Not a fix but a kludge until you get one.

        Replace

        ' <br>'

        with

        " <br>\n"

        and at least you'll get a new line after the <br> on the reports and email.

        You'd have to patch OrderScript.pl (in at least 2 places) to strip these <br> tags.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          removes package contents

          thx for the suggestion norman....im not sure where else i would have to patch order.pm cos it took me ages just using trial and error to find where to put the other 1 @_@

          but i tried what you said and it seems to remove my package contents in my order....the part with the quantity and description on the shipping and handling tab....theres just nothing there....do you have any ideas where abouts it would need fixing in Order.pm because if i cant get this to work then im going to have to completely re-arrange how my cart works..as it doesnt look very good having my order all on 1 line....still thx for your reply.

          Comment


            #6
            do you have any ideas where abouts it would need fixing in OrderScript.pm
            Sorry, no definite idea. It would take me ages to hunt through the code, make numerous test orders, etc, and I don't have the time for that.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              The FindComponent routine you are tinkering with allows an optional separator argument. Why not make use of this.

              You could restore ActinicOrder.pm to the original, change the line in FindComponent

              my $separator = shift || ',';

              to be

              my $separator = shift || '<br>';

              this means that the default behaviour is to use a <br> separator.

              and in OrderScript.pl look for the line

              @Response = ActinicOrder::FindComponent($pComponent,$VariantList);

              and add in a custom separator

              @Response = ActinicOrder::FindComponent($pComponent,$VariantList,"\r\n");

              and see what happens. This is all untested.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                unfortunately not ;0(

                i did originally look at the default sepparator....i'd previously tried replacing the ',' with '<br>'

                but im sure it either didnt work or gave me a script error....anyways...i tried your suggestion there and i also got a general script error.

                so will just have to tinker and see what happens....i just couldnt see why it was treating the <br> as html but showing it as text in the order.....

                but ill keep trying and if i come up with anything ill post it back here.

                cheers anyway norman

                Comment


                  #9
                  Steven,

                  Instead of mesing with the scripts, why dont you take out the <br> from within the scripts and instead place it in the "HTML for Name" of the Attribute?

                  Regards,
                  Bruce King
                  SellerDeck

                  Comment


                    #10
                    hi bruce

                    im editing the pm file because i was it to affect how the attributres are displayed in teh checkout process rather than the order pages...i also want the attributes on sepperate lines in the invoice.

                    as im not a perl programmer im just having to eperiment and see what happens.

                    while im here i dont suppose you know how to resolve the problem im having with the component permutations.

                    i have 1 component with roughly 30 permutations....these are all on 1 product...when i checkout it only seems to allow 1 permutation to be true......so if i place an order which results in 2 permutations being true...i need it to reduce the stock for 2 hidden products....but it only seems to allow 1 permutation....am i doing something wrong or is this just actinic?

                    hope you can help.

                    Comment


                      #11
                      Steve,

                      The issue with the <br> appearing in the reports is a Bug. Actinic needs to strip out the HTML before passing it to Crystal Reports but this does not happen, hence the values being passed as they are.

                      With the stock issue, I would suggest raising a new thread to help treat it as a separate issue. There seems to be some issue here as the stock should decrement correctly.

                      Kind regards,
                      Bruce King
                      SellerDeck

                      Comment


                        #12
                        This works.

                        You could restore ActinicOrder.pm to the original, change the line in FindComponent

                        my $separator = shift || ',';

                        to be

                        my $separator = shift || '<br>';

                        this means that the default behaviour is to use a <br> separator.

                        and in OrderScript.pl look for the line

                        my $sProdName = $$pComponent{'NAME'};

                        and add the following after it

                        $sProdName =~ s/<br>/\r\n -/ig;

                        this fixes the downloaded order.

                        Look for the block
                        Code:
                        		foreach $pComponent (@aComponentsSeparated)
                        			{
                        			#
                        			# Add component line
                        			#
                        			MailOrderLine( $pComponent->{'REFERENCE'},
                        								$pComponent->{'NAME'},
                        								$pComponent->{'QUANTITY'},
                        								$pComponent->{'PRICE'},
                        								$pComponent->{'COST'},
                        								$nDescriptionColumnWidth,
                        								@TableFormat
                        								);
                        and replace it with
                        Code:
                        		foreach $pComponent (@aComponentsSeparated)
                        			{
                        			my $sNameTemp = $pComponent->{'NAME'};
                        			$sNameTemp =~ s/<br>/\r\n -/ig;
                        			#
                        			# Add component line
                        			#
                        			MailOrderLine( $pComponent->{'REFERENCE'},
                        								$sNameTemp,
                        								$pComponent->{'QUANTITY'},
                        								$pComponent->{'PRICE'},
                        								$pComponent->{'COST'},
                        								$nDescriptionColumnWidth,
                        								@TableFormat
                        								);
                        this fixes the customer email.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment


                          #13
                          Norman,

                          Excellent stuff. You just love to hear us say it cannot be done!!!

                          Kind regards,
                          Bruce King
                          SellerDeck

                          Comment


                            #14
                            wowza

                            cheers norman....you're definitely the man......always finds the solution.

                            it does still display it all on 1 line when viewing the order in actinic but when the invoice is printed it display ok which is all that matters.

                            so big thx norman......although i did put a support request in with actinic about the inssue withe component permutations problem and they suggested compacting my databases......so i did this and now my pament method choices have dissapeared from my checkout process.??

                            but ill see what they say......so thanks again norman.

                            Comment

                            Working...
                            X