Announcement

Collapse
No announcement yet.

Passing products ordered to TradeDoubler script

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

    Passing products ordered to TradeDoubler script

    I’ve got a TradeDoubler tracking code setup in my Act_Order04.html template using JavaScript which is successfully passing NETQUOTEVAR:THEORDERNUMBER and NETQUOTEVAR:NUMERICORDERTOTALCGI but I also need it to pass through a reportInfo string containing details of the actual items ordered.

    For example:
    Product report
    Example product (you can add multiple products.
    Add | between them (f1...&f2...&f3...|f1...&f2...&f3...) )
    f1 is product number
    f2 is product name
    f3 is product value. Use dot (.) as decimal sign and no thousand separators.
    Bellow is an example, you must replace the products values.
    reportInfo = "f1=ProdNR01&f2=ProdName1&f3=100.00|f1=ProdNR02&f2=ProdName2&f3=1000.00";

    I've searched through the forums but I can't find anything to help me.

    Can anybody help me in getting this to work ?

    Thanks

    Peter
    Printerbase - Colour & Mono Laser Printers

    #2
    Hi there,

    I am checking this with my development team will keep you posted.
    [FONT=Verdana][COLOR=Navy]
    Regards,
    Karthik

    Comment


      #3
      Peter,

      To be able to do this will involve a very large script change. I have asked development to see if they can come up with suggestions but it may take some time coming. I will update here as and when I get information.

      Kind regards,
      Bruce King
      SellerDeck

      Comment


        #4
        Peter,

        Sorry for the delay. I have attached a modified OrderScript.pl, to get it to pass on the affiliate data..

        Add NETQUOTEVAR:AFFILIATEDATA to Act_Order04.html to add the cart affiliate data after NETQUOTEVAR:THEORDERNUMBER and NETQUOTEVAR:NUMERICORDERTOTALCGI.

        The script assumes that the currency has 2 decimal points and that the untaxed undiscounted values are to be passed to the affiliate script.

        I would suggest making a snapshot before making the changes. Let us know how you get along.

        Kind regards,
        Attached Files
        Bruce King
        SellerDeck

        Comment


          #5
          Hi,

          I will have a look at the script over the next few days and report back.

          Thanks

          Peter
          Printerbase - Colour & Mono Laser Printers

          Comment


            #6
            Hi,

            Sorry about the delay on coming back on this one, I’ve spent the last couple of week playing with the script.

            I couldn’t get the OrderScript.pl to work (kept getting a script error) so I pulled out the “sub GetAffiliateData” and the part that calls the GetAffiliateData and added them to my OrderScript.pl

            This still did not work so through trial and error I got it working by commenting out the part of the code in red from the “sub GetAffiliateData” which gets the price:
            Code:
            sub GetAffiliateData
            	{
            	my ($pCartList) = @_;
            	my $pCartObject = $::Session->GetCartObject($::TRUE);
            	my $sAffiliateData = "";
            	my @Response;
            	foreach my $pOrderDetail (@$pCartList)				# for each item in the cart
            		{
            		my %CurrentItem = %$pOrderDetail;				# get the next item
            		#
            		# Locate the section blob
            		#
            		@Response = ACTINIC::GetSectionBlobName($CurrentItem{SID}); # retrieve the blob name
            		if ($Response[0] != $::SUCCESS)
            			{
            			return (@Response);
            			}
            		my $sSectionBlobName = $Response[2];
            		#
            		# locate this product's object
            		#
            		@Response = ACTINIC::GetProduct($CurrentItem{"PRODUCT_REFERENCE"},  $sSectionBlobName, ACTINIC::GetPath());
            		if ($Response[0] != $::SUCCESS)
            			{
            			next;
            			}
            		my ($pProduct) = $Response[2];
            		my $nPrice;
            		#
            		# Get the product price 
            		#
            		my $nProductPrice;
            		my @aProductTax;
            		my ($nStatus, $sMessage);
            		my ($sTax1Band, $sTax2Band);
            
            #		($nStatus, $sMessage, $nProductPrice, 	$nPrice, $sTax1Band,	$sTax2Band,	@aProductTax) = 
            #			$pCartObject->GetCartItemPrice($pOrderDetail);
            #		if ($nStatus == $::FAILURE)				# general error
            #			{
            #			return ($nStatus, $sMessage);			# return error
            #			}	
            	
            		$sAffiliateData .= sprintf("%sf1=%s&f2=%s&f3=%d&f4=%1.2f",
            			$sAffiliateData eq "" ? "" : "|",
            			$CurrentItem{"PRODUCT_REFERENCE"},
            			$pProduct->{"NAME"},
            			$CurrentItem{"QUANTITY"},
            			$nProductPrice/100);
            		}
            	return ($::SUCCESS, '', $sAffiliateData);
            	}
            This now works and gives me all the information apart from the price for the cart items, I even managed to alter the script to give me the quantity. I tried playing around with the script to try and get the price part to work but unfortunately I didn't manage to get anywhere.


            I would be very grateful if somebody could take a look at the above code and hopefully point out what is wrong ?


            Just for completeness the code that calls the sub:
            Code:
            	@Response = GetAffiliateData($pCartList);
            	if ($Response[0] != $::SUCCESS)
            		{
            		return (@Response);
            		}
            	$::s_VariableTable{$::VARPREFIX.'AFFILIATEDATA'} = $Response[2];
            We are currently running the code on our test site (please ignore the missing images):
            http://www.printerbase.net/acatalog/..._hl5270dn.html

            Feel free to buy something (select Payment on account, we wont ship anything) and you will see on the receipt below the done button it outputs the information.

            Thanks

            Peter
            Printerbase - Colour & Mono Laser Printers

            Comment


              #7
              How did you go about doing this, ideal method would be to copy the file I provided and rename it 'orderscript.pl' place this in your site folder after backing up or removing the one that is in there.

              Once that is done you need to follow the other instructions which I guess you have done.

              If you have done it as i mentioned above, then can you tell us what were the error messages you get?

              Kind regards,
              Bruce King
              SellerDeck

              Comment


                #8
                When I copy the orderscript.pl file and upload it, I get a "500 Internal Server Error".

                The error happens when I choose the payment method and then click the "Next" button to go to the receipt page.

                I've uploaded with the ordescript.pl that you have provided and it is running on a test site at:
                http://www.printerbase.net/acatalog/..._hl5270dn.html

                I even tried commenting out the call to the GetAffiliateData but I still got the error, so I ran a file comparison program against your orderscript and mine, there were quite a few differences (mainly stuff about coupons) and pulled out the parts relating to GetAffiliateData. I am running Business 6.1.5.0.0.0.EGRA

                Peter
                Printerbase - Colour & Mono Laser Printers

                Comment


                  #9
                  I need to look this over, sorry for the delay in getting back to you on this one. I provided you with a v7 script. Need to rework it for v6 to see what is causing the issue, the scripts are quite different between the versions.

                  Kind regards,
                  Bruce King
                  SellerDeck

                  Comment


                    #10
                    Can you try the attached file and tell me how it goes please.

                    Kind regards,
                    Attached Files
                    Bruce King
                    SellerDeck

                    Comment


                      #11
                      I still get the 500 Internal Server Error.

                      Peter
                      Printerbase - Colour & Mono Laser Printers

                      Comment


                        #12
                        Peter,

                        Running this past development. Will update you.

                        Kind regards,
                        Bruce King
                        SellerDeck

                        Comment


                          #13
                          Peter,

                          The script is not working as intended for v6 because the 'CartManager.pm' function in V6 doesn't contain the 'sub GetCartItemPrice' routine. Which is called in 'sub GetAffiliateData'.

                          The 'GetCartItemPrice' was introduced in V7. There is no quick workaround at the moment and will take some time to get it right. I will post the fix here as soon as I have it from development.

                          Kind regards,
                          Bruce King
                          SellerDeck

                          Comment


                            #14
                            Thanks for all your help.

                            I think it’s about time we looked at upgrading and this is probably the kick we need.

                            I will probably look at upgrading to V8 multi-user, which I assume will solve the 'CartManager.pm' problem ?

                            Also before I get carried away with this, we store some other part numbers in the ‘Full Description’ and ‘Extended Information’ boxes, so would it be possible to pass the following variables as well:
                            INFOTEXT
                            PRODUCTDESCRIPTION

                            Peter
                            Printerbase - Colour & Mono Laser Printers

                            Comment


                              #15
                              We have now upgraded to V8 MU and I’ve got the script working to pass the price, name, Qty and reference, I just need to get the INFOTEXT and PRODUCTDESCRIPTION.

                              I’ve now started a new thread in the V8 section:
                              http://community.actinic.com/showthread.php?t=28470

                              Peter
                              Printerbase - Colour & Mono Laser Printers

                              Comment

                              Working...
                              X