chrometweaks.org

Question about Website tonight from iPage.com?

Click Here To View All Answers...


First question I got is Question about Website tonight from iPage.com? Hoping for any answer. My 2nd question... Hi,.

For an affiliate program I must have the posibility to read out te sub-total price on the checkout_success.php page with a invisible image..

I have to do that with the following code:.

<IMG SRC="http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?cashflow=$amount" border=0>.

Where I have to replace $amount with the tag that shows the subtotal price..

Whats the tag that show the subtotal price, and howe can I make that work?.

I cant program, so if you can help me with it I will be verry happy..

Thanx in advance.

Daniel..

Comments (198)

Hmm... I need to find out myself. I don't know what is the answer to your question. I'll do some investigation and get back to you if I bump into an good answer. You should email the people at iPage as they probably can answer it..

Comment #1

Did you even search the forums??.

I did I found a few threads.. however, THIS time I will save you the trouble:.

Http://forums.oscommerce.com/viewtopic.php...checkoutsuccess.

(I searched for "affiliate AND checkout_success" then I searched for "subtotal AND checkout_success" the list goes on.... use your head to think about what it is you want to search for and you will be suprised how many other people out there use an affiliate program and need the cookie-setting 1x1 pixel on their success page!)..

Comment #2

Hi,.

Thanx for your anwer, i''m going to look into that..

I had searchd on the forum, but on the words affiliate and groundbreak, and found out that a few people had it working, but there was no explanation how to do it..

Thanx.

Daniel..

Comment #3

Did you ever get it sorted out?.

If not, and also for any of you "search-buddies" (.

Hobbzilla coins a new term for people who find their own solutions to previously posted problems by being a "buddy" and utilitizing the.

Search.

Button. hobbzilla would also like to note he thinks he is clever for said term..

).

Here is an easy way to include the subtotal & order id by modifying a single file " catalog / checkout_success .php ".

Around line 52.

You will see:.

   if ($global['global_product_notifications'] != '1') {.

     $orders_query = tep_db_query("select orders_id from "TABLE_ORDERS" where customers_id = '"$customer_id"' order by date_purchased desc limit 1");.

     $orders = tep_db_fetch_array($orders_query);.

     $products_array = array();.

     $products_query = tep_db_query("select products_id, products_name from "TABLE_ORDERS_PRODUCTS" where orders_id = '"$orders['orders_id']"' order by products_name");.

     while ($products = tep_db_fetch_array($products_query)) {.

       $products_array[] = array('id' => $products['products_id'],.

                                 'text' => $products['products_name']);.

     }.

   }.

 }.

You can simply change this query to use the $last_order session variable..

OsC developers might also make use of this and save a db query to find what the order_id is.. well we already know it without making the $orders_query .. however we need the $orders_query now to find out the subtotal..

Anyway change above to:.

     $orders_query = tep_db_query("select value as subtotal, orders_id from "TABLE_ORDERS_TOTAL" where orders_id = '"$last_order"' AND class = 'ot_subtotal'");.

     $orders = tep_db_fetch_array($orders_query);.

     $products_array = array();.

     $products_query = tep_db_query("select products_id, products_name from "TABLE_ORDERS_PRODUCTS" where orders_id = '"$last_order"' order by products_name");.

     while ($products = tep_db_fetch_array($products_query)) {.

       $products_array[] = array('id' => $products['products_id'],.

                                 'text' => $products['products_name']);.

     }.

 }.

And now when you want to retrieve the subtotal & order_id (if you need more fields, you will have to modify $orders_query), use like this somewhere in the <! body_text //> section (commission junction example):.

..

..

..

     <tr>.

       <td>.

       <! Commission Junction Inc. Tracking Code Begins >.

       <?php echo '<img src="https://www.commission-junction.com/track/receive.dll?AMOUNT='substr($orders['subtotal'],0 , -2)'&CID=AFFILIATE_ID_NUMBER&OID='$orders['orders_id']'&TYPE=SALE&KEEP=YES&METHOD=IMG" height="1" width="1">'"n"?>.

       <! Commission Junction Inc. Tracking Code Ends >.

       </td>.

     </tr>.

..

..

...

Comment #4

Hello,.

I have been searching this forum for a solution for our affiliate program too. The solutions provided by others seem to have been blanked out or something, which is kind of frustrating..

Anyway, your example to return the values uses a php script to do it. We have a javascript which is suppose to be installed within the checkout_success page and need a couple of tags to be inserted within the script for the subtotal and the orderid. Could you help by providing the the necessary tags?..

Comment #5

Wow this thread is great. Someone promised me they would install UA for me back in november, but for some reason they never got round to it, and just kept fobbing me off. After a lot of hair pulling I have got it installed and set up and almost working, the only problem is triggering the sale..

I am now going to go with the same way that dfeenstra did and use the code in my chekcout succes page.

I have read this thread and searched and looked at what everybody else has said, and I am a newbie and quite stupid when it comes to code and dont see how the code above by hobzilla fits in with what I am trying to do. I dont know how to mix cgi and php.

I dont mean to be a pain, but can someone tell me in stupid newbie language what I have to replace the $amount" with, and if I have to make any other changes to the page??.

I hope someone can help..

Comment #6

Hotnuts21,.

Several things have changed since I posted my code.. $last_order is no longer.. therefore, you have to add in another SQL query..

Here is the current catalog/checkout_success.php file with my updates and the changes you said you needed. You can at least use it as a guide..

HTH.

(NOTE: checkout_success.php is by default a SSL page.. therefore, you need to make sure that.

Php source code:.

Http://www.hobbzilla.com/oscommerce/checko...ut_success.phps.

Easier to read color coded HTML file:.

Http://www.hobbzilla.com/oscommerce/checko...ut_success.html..

Comment #7

I just setup an MLM/Multi-Tiered affiliate management system from.

Www.affiliateproject.com.

And would like to use oscommerce as the shopping cart/order system..

According to the directions I am support to insert the code below into the checkout_success.php page and use the tags from the cart to replace the info needed in the brackets. After looking into some of these posts it seems it isnt as simple as indicated..

Has anyone ever integrated the Advantage APS product before or know how to install the script below?.

<! Begin.

 function oxcpage().

 {.

   window.open("http://www.3n1.net/cgi-bin/aps.pl?section=regsales&return_amt=[ST]&return_transid=[ORDERNUMBER]&return_affiliate=    ",'OxcPage', 'scrollbars,HEIGHT=1,WIDTH=1').

 }.

//  End >.

</script>..

Comment #8

Around line 40 Remove:.

If ($global['global_product_notifications'] != '1') {.

And it's cooresponding.

}.

Add the following query under the orders_query:.

   $orders_total_query = tep_db_query("select value as subtotal, orders_id from "TABLE_ORDERS_TOTAL" where orders_id = '"$orders['orders_id']"' AND class = 'ot_subtotal'");.

   $orders_total = tep_db_fetch_array($orders_total_query);.

Add this right before </head>.

<SCRIPT LANGUAGE="JavaScript">.

<! Begin.

 function confirmationpage().

 {.

Window.open("http://www.3n1.net/cgi-bin/apl.pl?section=regsales&return_amt=<?php echo substr($orders_total['subtotal'],0 , -2); ?>&return_transid=3n1.commerce<?php echo $orders['orders_id']; ?>&return_affiliate=XXXXXX",'confirmationPage', 'scrollbars,HEIGHT=1,WIDTH=1').

 }.

//  End >.

</script>.

And call.

OnLoad="confirmationpage();".

In <body>. That should do it!..

Comment #9

Well I still don't understand how to do this?.

Could someone please ammend the following code for me and re-post it here so I can make my tracking work. I have tried everywhere to get a solution for this..

<IMG border=0 hspace=0 vspace=0 width=1 height=1 src="https://counter2.hitslink.com/confirmation.asp?acct=myaccountname&type=xxx&s=xxx&uniqueId=YOUR-UNIQUE-ID&orderAmount=YOUR-ORDER-AMOUNT">.

How do I ammend the above code to return the order number and amount to my tracking company?..

Comment #10

This PHP worked on mine. Once I determined what the order ID was I created a variable, let's call it OrID..

OrID= $orders['orders_id'];.

Then I modified the code you're talking about with this:.

<IMG border=0 hspace=0 vspace=0 width=1 height=1.

Src="https://counter2.hitslink.com/confirmation.asp?acct=shoppingxxx&type=9719&s=205&orderAmount=YOUR-ORDER-AMOUNT&uniqueId=<?php.

Echo $OrID; ?>">.

I didn't bother to get the order amount yet. Getting the ID to show up on the hitlinks reports is enough for now..

Hope this helps!..

Comment #11

I'm running into the same thing now with a different affiliate network (clixGalore) and some different code. The code I'm supposed to implement is here:.

<!begin clixGalore code copyright 2003 >.

<img.

Src="https://www.clixGalore.com/AdvTransaction.aspx?AdID=1761&SV=SALE_AMOUNT_HERE&OID=AN_ORDER_ID" height="0" width="0" border="0">.

<!end clixGalore code >.

We're supposed to replace "SALE_AMOU?NT_HERE" with a sales total variable, and "AN_ORDER_ID" with an order ID variable. There are a couple of other postings on the forums about implementing the clixGalore code, but none have quite answered the problem..

I've been experimenting with it myself,and trying to implement some of the code from this forum, but can't quite get it. I added the following code and it broke the page completely with a parse error on line 46 ($orders_query...)..

Lines 40 - 58....

/* if ($global['global_product_notifications'] !=.

'1') { ... removed to add clixGalore code below.

... */.

$orders_query = tep_db_query("select orders_id.

From "TABLE_ORDERS" where customers_id = '".

(int)$customer_id"' order by date_purchased desc.

Limit 1");.

$orders = tep_db_fetch_array($orders_query);.

/* ... BEGIN clixGalore code ... */.

$orders_total_query = tep_db_query("select value.

As subtotal, orders_id from "TABLE_ORDERS_TOTAL.

" where orders_id = '"$orders['orders_id']"'.

AND class = 'ot_subtotal'");.

$orders_total =.

Tep_db_fetch_array($orders_total_query);.

/* ... END clixGalore code ... */.

$products_array = array();.

$products_query = tep_db_query("select.

Products_id, products_name from ".

TABLE_ORDERS_PRODUCTS" where orders_id = '".

(int)$orders['orders_id']"' order by.

Products_name");.

While ($products =.

Tep_db_fetch_array($products_query)) {.

$products_array[] = array('id' =>.

$products['products_id'],.

'text' =>.

$products['products_name']);.

/* } ... removed to add clixGalore code.

Above ... */.

AND Lines 167 - 173....

</body>.

<!begin clixGalore code, copyright 2004 >.

<img src="https://www.clixGalore.com/.

AdvTransaction.aspx?AdID=2853&SV==<?php echo.

Substr($orders_total['subtotal'],0 , -2); ?>&OID=<?.

Php echo $orders['orders_id']; ?>" height="0".

Width="0" border="0">.

<!end clixGalore code >.

</html>.

Anyway, would definitely appreciate any help or direction. I'm still fighting through this one!.

Thanks,.

JAB*..

Comment #12

Put this code at the bottom of the page..

Here is how to get the order total:.

$this_order_total_query = tep_db_query("SELECT value FROM "TABLE_ORDERS_TOTAL" WHERE orders_id = '"(int)$insert_id"' AND class = 'ot_total'");.

$this_order_total = tep_db_fetch_array($this_order_total_query);.

Here is how to get the order subtotal:.

$this_order_subtotal_query = tep_db_query("SELECT value FROM "TABLE_ORDERS_TOTAL" WHERE orders_id = '"(int)$insert_id"' AND class = 'ot_subtotal'");.

$this_order_subtotal = tep_db_fetch_array($this_order_subtotal_query);.

Here is how to get the order's shipping:.

$this_order_shipping_query = tep_db_query("SELECT value FROM "TABLE_ORDERS_TOTAL" WHERE orders_id = '"(int)$insert_id"' AND class = 'ot_shipping'");.

$this_order_shipping = tep_db_fetch_array($this_order_shipping_query);.

Basically replace ot_WHATEVER with whatever order total line item you want...

Comment #13

Recaddy, thanks for your reply!.

So if I wanted to implement the sub-total into my code and an order id is this going to work?.

<!begin clixGalore code, copyright 2004 >.

<img src="https://www.clixGalore.com/AdvTransaction.aspx?AdID=2853&SV=<?php $this_order_subtotal_query = tep_db_query("SELECT value FROM "TABLE_ORDERS_TOTAL" WHERE orders_id = '"(int)$insert_id"' AND class = 'ot_subtotal'");.

$this_order_subtotal = tep_db_fetch_array($this_order_subtotal_query); ?>&OID=<?php echo $orders['orders_id']; ?>" height="0" width="0" border="0">.

<!end clixGalore code >.

Is this order id code going to work???.

<?php echo $orders['orders_id']; ?>.

Thanks again! I really appreciate your time!..

Comment #14

For some reason this code didn't work. I implemented it and tested, and the affiliate program is reporting an impression and click-thru, but no sale?????..

Comment #15

More information....

I did get the following code to at least interact with clixGalore by pasting it on line 80-82 (right after HEADING_TITLE); however, it is not passing the sub-total. clixGalore is recording everything else, but it's giving an order total of $0.00..

<!begin clixGalore code, copyright 2004 >.

<img src="https://www.clixGalore.com/AdvTransaction.aspx?AdID=2853&SV=<?php echo $this_order_subtotal_query = tep_db_query("SELECT value FROM "TABLE_ORDERS_TOTAL" WHERE orders_id = '"(int)$insert_id"' AND class = 'ot_subtotal'"); $this_order_subtotal = tep_db_fetch_array($this_order_subtotal_query); ?>&OID=<?php echo $orders['orders_id']; ?>" height="0" width="0" border="0">.

<!end clixGalore code >..

Comment #16

Just a note to follow up... I'd never purposely slander any person or company, so I will just offer a kind warning. Make sure you check these places out thoroughly before you put your credit card number down; in particular, make sure you can contact the company and that the company will respond..

Unfortunately I've been burned no this one.....

Comment #17

I got my clixgalore account to work. The checkout_success.php now sends the subtotal and order ID to clixgalore without any problems. If anyone wants to try it, this is the exact code I used:.

<?php  .

$this_order_subtotal_query = tep_db_query("SELECT value FROM "TABLE_ORDERS_TOTAL" WHERE orders_id = '"(int)$orders['orders_id']"' AND class = 'ot_subtotal'");.

$this_order_subtotal = tep_db_fetch_array($this_order_subtotal_query);.

?>.

 .

<!begin clixGalore code, copyright 2004 >.

<img src="https://www.clixGalore.com/AdvTransaction.aspx?AdID=3012&SV=<?php echo $this_order_subtotal['value']; ?>&OID=<?php echo $orders['orders_id']; ?>" height="0" width="0" border="0">.

<!end clixGalore code >.

 .

Replace AdID=3012 with whatever your clixgalore AdID is. Hope this helps...

Comment #18

Tj1000 -.

That's good to hear! I would be very interested in hearing how it goes for you, please continue to post with your experience..

I'm holding off on an affiliate program right now. I did contact FineClicks and was happy to get a number of responses from them about their company and coding specifics..

JAB*..

Comment #19

Hi,.

For an affiliate program I must have the posibility to read out te sub-total price on the checkout_success.php page with a invisible image..

I have to do that with the following code:.

<IMG SRC="http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?cashflow=$amount" border=0>.

Where I have to replace $amount with the tag that shows the subtotal price..

Whats the tag that show the subtotal price, and howe can I make that work?.

I cant program, so if you can help me with it I will be verry happy..

Thanx in advance.

Daniel..

Comment #20

The program where it's for is groundbreak, so mabey someone alreade intergrated this program and can help me..

Iff it is posible I also want to read oud the order nummer..

Thanx in advance.

Daniel..

Comment #21


This question was taken from a support group/message board and re-posted here so others can learn from it.