Forums / General Questions / Adding HTML for Affilliate website to my Checkout_confirmation page

Adding HTML for Affilliate website to my Checkout_confirmation page

Locked

Views: 2,377

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
11 Mar 2009, 1:41 PM
#1
clarkeyi avatar

clarkeyi

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Adding HTML for Affilliate website to my Checkout_confirmation page

Hello

I am new to Zencart. One of my first tasks is to add HTML code from affilliatefuture.co.uk. I need to add this into my order confirmation page.
My problem is that when I download the page it is just in PHP and cannot see where I would add the code.
Am I missing something such as a related HTML page or am I trying to edit the wrong information.

When I checkout the URL is /index.php?main_page=checkout_confirmation

I have downloaded the checkput_confirmation.php file to try and edit?

Any help if anyone has set code up in their confirmation code would be grateful

Cheers

11 Mar 2009, 2:24 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

As far as I am aware, any tracker code for affiliates should be part of the checkout_success process - ie: tracker invokes AFTER payment has been made...

I know that the tracker for JROX (free affiliate software for 50 affiliates - bypassing commercial affiliate programs' crippling fees!) is added to a "custom" footer.php that is then in turn placed in a new directory called "checkout_success".

Look for posts on JROX JAM integration code for further ideas.

20 years a Zencart User

11 Mar 2009, 2:25 PM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

The template file for your checkout_confirmation page is in tpl_checkout_confirmation_default.php. That's the appropriate place to add your affiliate HTML.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

11 Mar 2009, 2:29 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

The JROX approach is non-standard. Somehow it works even though structure is odd and HTML are broken. I suspect that it was written for an earlier version of Zen Cart and is somehow limping along, but there's no guarantee that it will continue to work in the newly restructured Zen Cart 2.0.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

11 Mar 2009, 2:33 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

Kuroi... why would this be checkout_confirmation and not checkout_success? (as is the case with jrox)

My thinking is that at checkout_confirmation, the cart has not yet ensured payment is received... It's not a good idea to have commissions calculated at a point where there could be no cash transacted?

What if checkout_confirmation progresses to payment gateway - and shopper then abandons the purchase?

Your thoughts... ?

20 years a Zencart User

11 Mar 2009, 2:35 PM
#6
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

Schoolboy, you are correct. I picked up the reference to checkout_confirmation from the original post and carried it forward without thinking. It should be tpl_checkout_success_default.php. My bad. Apologies for the confusion.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

11 Mar 2009, 2:47 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

Tx Kuroi... now how do we help clarkeyi insert it... ?

clarkeyi - if you are there... Show us the affiliatefuture html code (remove any sensitive data by replacing it with xxxxxxxx or something, but make sure we can interpret its structure.)

20 years a Zencart User

11 Mar 2009, 3:57 PM
#8
clarkeyi avatar

clarkeyi

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

Thanks for the advice. Hopefully it is just a case of adding it to tpl_checkout_success_default.php

The code is below:

**html>

<head> </head> <body>

Your website code here. Add this code beneath.

<script language="javascript" src="https://scripts.affiliatefuture.com/AFFunctions.js"></script> <script language="javascript"> var merchantID = xxxx ; var orderValue = 'ORDER_VALUE'; var orderRef = 'ORDER_REF'; var payoutCodes = ''; var offlineCode = ''; AFProcessSaleV2(merchantID, orderValue, orderRef,payoutCodes,offlineCode); </script> </body> </html>**

Thanks

11 Mar 2009, 4:37 PM
#9
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

OK, the bit that's relevant is:

<script language="javascript" src="https://scripts.affiliatefuture.com/AFFunctions.js"></script>
<script language="javascript">

var merchantID = xxxx ;
var orderValue = 'ORDER_VALUE';
var orderRef = 'ORDER_REF';
var payoutCodes = '';
var offlineCode = '';

AFProcessSaleV2(merchantID, orderValue, orderRef,payoutCodes,offlineCode);

</script>

You don't need the HTML headers or the closing tags - just the bit I show above.

It's probably just a case of pasting that code right at the bottom of the tpl_checkout_success_default.php file .

But I don't know how ZC is going to "parse" the ORDER_VALUE and ORDER_REF data.... ??? It may need ZC's specific references here...

Kuroi--- you're the guru in this dept! :D

20 years a Zencart User

11 Mar 2009, 4:56 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

This thread may help you with the PARSING challenge!

http://www.zen-cart.com/forum/showthread.php?t=112649

20 years a Zencart User

11 Mar 2009, 5:11 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

OK... I think I have a solution!

  1. CREATE A NEW FOLDER called checkout_success in the following path:

includes/templates/YOUR-TEMPLATE-NAME/checkout_success

  1. FTP a COPY of the common tpl_footer.php file to your local machine:

includes/templates/template_default/common/tpl_footer.php

  1. Open it for EDITING, using a plain text editor.

  2. Right at the BOTTOM of that file, paste the following:

<script language="javascript" src="https://scripts.affiliatefuture.com/AFFunctions.js"></script>
<script language="javascript">

var merchantID = xxxx ;
var orderValue = '<?php echo $order_summary['commissionable_order'];?>';
var orderRef = '<?php echo $order_summary['order_number'];?>';
var payoutCodes = '';
var offlineCode = '';

AFProcessSaleV2(merchantID, orderValue, orderRef,payoutCodes,offlineCode);

</script>

(Remember to re-insert your merchantID and any other stuff you removed when posting the data on this forum)

  1. SAVE the file on your hard drive.

  2. FTP it to:

includes/templates/YOUR-TEMPLATE-NAME/checkout_success

So you now have it as follows:

includes/templates/YOUR-TEMPLATE-NAME/checkout_success/tpl_footer.php

20 years a Zencart User

11 Mar 2009, 5:17 PM
#12
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

Just to explain why the folder checkout_success is relevant here...

As the affiliate code is ONLY valuable at checkout_success, creating and naming a folder provides a SPECIFIC PAGE OVER-RIDE for the tpl_footer.php inside it. (In this case, the page is - you guessed it - checkout_success)

ALL other "pages" on your site will continue to use tpl_footer in the common folder.

Additionally, (according to drbyte) you need to put the ZC variables...

<?php echo $order_summary['commissionable_order'];?>
<?php echo $order_summary['order_number'];?>

... into tpl_footer.php for them to work. Apparrently, putting them elsewhere won't help, and they won't work!

20 years a Zencart User

11 Mar 2009, 5:28 PM
#13
clarkeyi avatar

clarkeyi

New Zenner

Join Date:
Mar 2009
Posts:
9
Plugin Contributions:
0

Re: Adding HTML for Affilliate website to my Checkout_confirmation page

Thanks for all of the information provided
I will set this up over the next few days and test.

Cheers