Announcement

Collapse
No announcement yet.

Formatting Attribute name in shopping cart

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

    Formatting Attribute name in shopping cart

    Hi All

    I want to change the look of the list of attribute names as they appear in the cart for a particular product.

    I know that I can do this by adding the relevant HTML formatting to the Attribute Name field for the product. However, this formatting is then carried on into the order confirmation email and the downloaded order details as well.

    i.e. I get the following appearing in the order details:

    <b>Colour</b>: Claret / Heather, <BR><b>Size</b>: Small

    Looks how I want it in the cart, but looks a mess in the order details.

    Can anyone suggest an alternative way of doing this?

    Thanks

    Bob
    Bob Smith
    Quality Workwear Clothing
    Personalised Corporate wear
    www.workwearhouse.co.uk

    #2
    im not sure about attributes myself... but is there not a seperate NETQUOTEVAR for the attribute name and the attribute choice?

    and if not could you not just set it up so you have a CUSTOMVAR for the attribute name and then have:

    <b>CUSTOMVAR:ATTRIBNAME:</b> NETQUOTEVAR:ATTRIBVALUE

    or similiar?

    Comment


      #3
      Custom properties aren't easily available in the Cart and Checkout (unless you want to do a lot of Perl patching).

      You could patch ActinicOrder.pl to strip out <...> in the attribute names. You'd need to do this in the routine.

      sub GetSaferBlob

      look for

      Code:
      		foreach $pComponent (@{$CurrentItem{'COMPONENTS'}})
      			{
      			my $sProdName = $$pComponent{'NAME'};
      add the line below

      Code:
      			$sProdName =~ s/\<.*?\>//g; # strip HTML tags
      Also the customer e-mail may need fixing. Look for

      sub MailOrderLine

      and locate the line

      Code:
      	$sName =~ s/(!!\<|\>!!)//g;						# I hope product names don't contain embedded HTML, but if they do, try to just strip the boundary markers
      add below it

      Code:
      	$sName =~ s/\<.*?\>//g; #Remove any HTML tags
      I've not tested any of this so that's up to you.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Norman

        You're a star !!

        I found the code you mentioned in OrderScript.pl (not ActinicOrder as per your post). I made the changes you suggested and it works a treat.


        Many thanks
        Happy new year

        Bob
        Bob Smith
        Quality Workwear Clothing
        Personalised Corporate wear
        www.workwearhouse.co.uk

        Comment


          #5
          Ooops. Sorry about mentioning the wrong script. Bet that confused you a bit.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Hi Norman,

            I have a similar issue with HTML tags in the Product Name field being passed through to the customer receipt and the downloaded order - does the above patch work the same for this field also?

            Thanks

            John


            Bikster
            SellerDeck Designs and Responsive Themes

            Comment


              #7
              Different place. Look in OrderScript.pl for

              Code:
              		$objOrderBlob->AddString($$pProduct{"NAME"};
              REPLACE it with
              Code:
              		my $tempfix = $$pProduct{"NAME"};
              		$tempfix =~ s/(!!\<|\>!!)//g;		# remove any escape tags
              		$tempfix =~ s/\<.*?\>//g;		# remove any HTML tags
              		$objOrderBlob->AddString($tempfix);
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Many, many thanks Norman - will give it a whirl straight away


                Bikster
                SellerDeck Designs and Responsive Themes

                Comment


                  #9
                  I edited the post above a couple of times (due to typos - I've only eyeball tested it) so make sure you revisit it now to get the corrected version.

                  Also the above is only for the downloaded orders. Do you need this for the Customer e-mail as well?
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    If you need the customer email fixed then edit OrderScript.pl and

                    REPLACE

                    Code:
                    		if (!$bProductSupressed)
                    			{
                    			#
                    			# Add product line
                    			#
                    			MailOrderLine( $$pProduct{REFERENCE},
                    								$$pProduct{NAME},
                    								$$pOrderDetail{QUANTITY},
                    								$CurrentItem{'PRICE'},
                    								$CurrentItem{'COST'},
                    								$nDescriptionColumnWidth,
                    								@TableFormat
                    								);
                    			if ($CurrentItem{'DDLINK'} ne "")
                    				{
                    				push @aDownloadLinks, MailDownloadLink($$pProduct{REFERENCE}, $$pProduct{NAME}, $CurrentItem{'DDLINK'});
                    				}
                    			}

                    WITH

                    Code:
                    		if (!$bProductSupressed)
                    			{
                    			#
                    			# Add product line
                    			#
                    			my $tempfix = $$pProduct{"NAME"};
                    			$tempfix =~ s/(!!\<|\>!!)//g;		# remove any escape tags
                    			$tempfix =~ s/\<.*?\>//g;		# remove any HTML tags
                    			MailOrderLine( $$pProduct{REFERENCE},
                    								$tempfix,
                    								$$pOrderDetail{QUANTITY},
                    								$CurrentItem{'PRICE'},
                    								$CurrentItem{'COST'},
                    								$nDescriptionColumnWidth,
                    								@TableFormat
                    								);
                    			if ($CurrentItem{'DDLINK'} ne "")
                    				{
                    				push @aDownloadLinks, MailDownloadLink($$pProduct{REFERENCE}, $tempfix, $CurrentItem{'DDLINK'});
                    				}
                    			}
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Didn't quite strip out all the tags in the customer receipt but did in the downloaded order

                      originally had !!<<div align=center"><h3>Product Name</h3></div>>!!

                      now just get !!Product Name>!! in the customer receipt email - close enough - thanks again Norman


                      Bikster
                      SellerDeck Designs and Responsive Themes

                      Comment


                        #12
                        Weird. If you're using that bigger patch (2 above) it should remove all !!< and >!! before it strips anything (of minimum length) between < and >
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment


                          #13
                          After a nightmare evening of killing a website - NEVER EVER hit the innocent looking "cancel" button during an upload <this must be some kind of in-house humour with Actinic> the whole lot went haywire.

                          Having finally got the site back online (thanks to James at Actinic) I implemented the above patch and this time it worked a treat - must have missed a "{" or something originally - just thought I should let others know in case they want to use the above patch to remove the HTML from product lines. Thanks again to Norman.


                          Bikster
                          SellerDeck Designs and Responsive Themes

                          Comment

                          Working...
                          X