Zen Cart Logo
Forums / General Questions / Adding Code to checkout_success.php

Adding Code to checkout_success.php

Locked

Views: 9,892

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
7 Dec 2009, 5:17 AM
#1
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Adding Code to checkout_success.php

Hi, in order to track sales I was given the following information: I believe i should be this page I need to alter: shop\include\languages\english\checkout_success.php
My questions are:
1 Am I correct in saying it is the checkout_success.php that I need to put this tracking code into?
2 What snippet of code should I enter in the green part and what snippet of code should be entred in the orange part.

Many Thanks
Renz

Please copy & paste the following code on the 'Thank you' page or the 'Order Confirmation' page within your shopping basket.

<!-- Getprice.com.au sales tracking system -->

<img height="1" width="1" border="0"src="https://secure.getprice.com.au/affsale.asp?shopid=1434&price=400&sid=1981">

<!-- End Getprice.com.au -->

Note:

In red is your shop id number in our system (1434)
In green is the price of the product (this should be entered by your system dynamically for each product)
In orange is the sale id in your system (this should be entered by your system)

7 Dec 2009, 5:25 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding Code to checkout_success.php

Some questions first ...

Which version of Zen Cart are you using?
What addons do you have installed?
Did you build your template using a custom override folder?

7 Dec 2009, 5:34 AM
#3
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

Hi Dr. Byte....Greetings From Oz

Zen vs 138A

Phew Add Ons one or two.
1 Admin Log in As Customer vs 2.0
2 Au Post
3 Automated Currency Update V3-1
4 Captcha TTF
5 Enhanced Who is online 1-0-3
6 Encrypted Master PW Vs 1.2
7 How did you hear about us 1.3.8A
8 Zen Cart Export All
9 Image Handler 2.0
10 Monthly Sales Tax Summery V 1.3
11 Scroller
12 Simple Bank Deposit
12 Sitemap XML
13 Back Up MYSQL plug in V 1.3
14 Security Patch v138_20090619
15 Purchase Orders V 3.12

Yes I have Customs Overrides..(theme163) are my template files

Regards
Renz

7 Dec 2009, 7:09 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding Code to checkout_success.php

Okay. You won't be editing your checkout_success.php language file.

Follow this FAQ instead: https://www.zen-cart.com/tutorials/index.php?article=399

7 Dec 2009, 7:55 AM
#5
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

Hi Dr. Byte,

So in following what you have suggested and bearing in mind my php is non existent, would the following be correct (obviously in) /includes/templates/YOUR_CUSTOM_TEMPLATE_NAME/checkout_success/tpl_footer.php

Thanking you
RR

<!-- Getprice.com.au sales tracking system -->

<img height="1" width="1" border="0"src="https://secure.getprice.com.au/affsale.asp?shopid=1434&price=<?php echo$order_summary['order_total']; ?>&sid=<?php echo $order_summary['order_number']; ?> ">

<!-- End Getprice.com.au -->
7 Dec 2009, 8:09 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding Code to checkout_success.php

Yes, but remember to leave a space between "echo" and "$order_summary"

7 Dec 2009, 8:15 AM
#7
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

Thanks a Million, this should be correct withe the space added, although I was unsure about the extra "> at the end......

<!-- Getprice.com.au sales tracking system -->

<img height="1" width="1" border="0"src="https://secure.getprice.com.au/affsale.asp?shopid=1434&price=<?php echo $order_summary['order_total']; ?>&sid=<?php echo $order_summary['order_number']; ?> ">

<!-- End Getprice.com.au -->
7 Dec 2009, 8:29 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding Code to checkout_success.php

Yes, the 'extra' "> is needed. Actually, better syntax would be:

" />
10 Dec 2009, 8:22 AM
#9
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

Hi Doctor Byte,

A quick question if I may, I waited a couple of days to see if it was tracking succesfully, however I feel I may have made a mistake as it is not reporting that I have made sales. Would you be so kind and advise if I have entered it in the file correctly or should it be before the end..?> I'll copy the file below.

Thanks
Best Regards always
Renz

<?php /** * Common Template - tpl_footer.php * * this file can be copied to /templates/your_template_dir/pagename<br /> * example: to override the privacy page<br /> * make a directory /templates/my_template/privacy<br /> * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_footer.php<br /> * to override the global settings and turn off the footer un-comment the following line:<br /> * <br /> * $flag_disable_footer = true;<br /> * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_footer.php 3183 2006-03-14 07:58:59Z birdbrain $ */ require(DIR_WS_MODULES . zen_get_module_directory('footer.php')); ?> <?php if (!$flag_disable_footer) { ?> <div class="footer"> <div class="right"> <?php echo zen_image(DIR_WS_TEMPLATE.'images/carts.gif'); ?> </div> <div class="left"> <div class="margin"> <?php if (EZPAGES_STATUS_FOOTER == '1' or (EZPAGES_STATUS_FOOTER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?> <a href="<?php echo HTTP_SERVER . DIR_WS_CATALOG; ?>"><?php echo HEADER_TITLE_CATALOG; ?></a> <?php require($template->get_template_dir('tpl_ezpages_bar_footer.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_footer.php'); ?> <?php } ?> <div class="copy"align="center"> <?php echo FOOTER_TEXT_BODY; ?> </a> <?php if (SHOW_FOOTER_IP == '1') { ?> <div id="siteinfoIP"><?php echo TEXT_YOUR_IP_ADDRESS . ' ' . $_SERVER['REMOTE_ADDR']; ?></div> <?php } ?> </div> </div> </div> <div class="left"> <div class="margin1"> <?php echo zen_image(DIR_WS_TEMPLATE.'images/geotrust.jpg'); ?></div> </div> <?php } // flag_disable_footer ?> <!-- Getprice.com.au sales tracking system -->

<img height="1" width="1" border="0"src="https://secure.getprice.com.au/affsale.asp?shopid=1434&price=<?php echo $order_summary['order_subtotal']; ?>&sid=<?php echo $order_summary['order_number']; ?> " />

<!-- End Getprice.com.au -->
10 Dec 2009, 9:56 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding Code to checkout_success.php

You've added it in an acceptable place.

Although, I'm unclear as to why you changed "order_total" to "order_subtotal". Granted, that wouldn't cause it to not send the details ... the numbers would just be bad.

10 Dec 2009, 10:03 PM
#11
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

Hi There,

Thanks for that, I thought I was good but doubted myself when it didn't report in, the issue must be their end.

Re. I changed "order_total" to "order_subtotal" unless I am mistaken the sub is the price I sold the item for and total is including postage etc. I was just looking to calculate the sale.

Cheers

RR

5 Mar 2010, 2:34 AM
#12
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

Dear Dr. Byte

I wonder if you could shed some light on this. I have the following code as we have discussed before, however I have added another code as well for another comparison engine called myshopping.com.au. Now both getprice.com.au and myshopping.com.au report the same sale as originating from their link (in their cp). Is it because of the code below or is it because they both use the one datafeed.

Best Regards

Renz

<!-- Getprice.com.au sales tracking system -->

<img height="1" width="1" border="0"src="https://secure.getprice.com.au/affsale.asp?shopid=1434&price=<?php echo $order_summary['order_total']; ?>&sid=<?php echo $order_summary['order_number']; ?> " />

<!-- End Getprice.com.au --> <!--MyShopping.com.au Code for Purchase Conversion Page --> <img height=0 width=0 src="https://www.myshopping.com.au/sale.asp?mid=2065&amount=<?php echo $order_summary['order_total']; ?>&order=<?php echo $order_summary['order_number']; ?> " /> <!-- MyShopping.com.au -->
5 Mar 2010, 9:37 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding Code to checkout_success.php

Renz:

Now both getprice.com.au and myshopping.com.au report the same sale as originating from their link (in their cp). Is it because of the code below or is it because they both use the one datafeed.I'm puzzled about what you mean by "originating from their link".
This would seem to not be a Zen Cart issue, but rather something you need to ask them about.

5 Mar 2010, 11:34 AM
#14
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

Hi Dr. Byte,

I am trying to determine why both comparison engines are returning a sale in their control panel, as far as I can understand there can only be 2 reasons 1 is that it's happening because they both use the same data feed as follows

http://www.adulttoys4u.com.au/shop/m1_export.php?export=getprice_xml&live=1 which of course you are quite correct is nothing to do with zen cart.

The other is that somehow this code is causing it:

<!-- Getprice.com.au sales tracking system -->

<img height="1" width="1" border="0"src="https://secure.getprice.com.au/affsale.asp?shopid=1434&price=<?php echo $order_summary['order_total']; ?>&sid=<?php echo $order_summary['order_number']; ?> " />

<!-- End Getprice.com.au --> <!--MyShopping.com.au Code for Purchase Conversion Page --> <img height=0 width=0 src="https://www.myshopping.com.au/sale.asp?mid=2065&amount=<?php echo $order_summary['order_total']; ?>&order=<?php echo $order_summary['order_number']; ?> " /> <!-- MyShopping.com.au -->

Of course I am expecting you to tell me....no way buddy, the code is Ok and you have it in the right place...and to go knocking on their door for answers..As you have already ok the get price code and location in the past the only change is the addition of the my shopping code in the same place......But I am doubting that this would cause the problem..but need to check it's not a possibility.

Just to clarify this "originating from their link" means that they found my product in a comparison engine by clicking their link they end up on to my site and of course only the donor link and company should take credit for the sale not both of them...

Cheers for now

Renz

6 Mar 2010, 11:25 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding Code to checkout_success.php

Okay, but don't you have tracking code set up to send to BOTH of them? ie: you've added the tracking-pixel <img....> code for both of them to your template. Thus, they're BOTH going to be notified of every sale made on your store, regardless of origin.

I would think that it's up to them to honestly report whether the sale was referred by them to you, or to admit that the sale was not a result of a click from their channels.

8 Mar 2010, 2:14 AM
#16
kevinp22 avatar

kevinp22

New Zenner

Join Date:
Mar 2010
Posts:
1
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

DrByte is right, both companies are tracking sales. And actually both of them are probably honest and report your sale correctly. The reason is that customer can click on your product from both comparison engines. It happens all the time, type in google product name and you see the same products listed in google from different comparison engines. You may click on one of them, then another. This way, not only two, but more comparison engines can register click to your site and as a result a sale (if customer finally buy something).
Maybe you know, majority of visitors comes to comparison engines from google and some of customers do research using more then one comparison engine. Therefore you may expect such problem from time to time. But if ALL your sales reported by both engines, then it’s error in sales code installation. How many sales you’ve got from comparison engines in total?

25 Mar 2010, 3:15 AM
#17
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: Adding Code to checkout_success.php

Hi Dr. Byte, I have a very similar question regarding code for conversion from google and location to enter this code into an earlier version of zen cart 1.3.0.2. I posted the question in General but out of all the people who viewed it no-one has responded, I was wondering if your wealth of knowledge could help. http://www.zen-cart.com/forum/showthread.php?p=860728#post860728