Zen Cart Logo
Forums / General Questions / Affiliate program tpl_checkout_success_default issue

Affiliate program tpl_checkout_success_default issue

Locked

Views: 939

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
24 Sep 2009, 1:22 AM
#1
ahall13 avatar

ahall13

New Zenner

Join Date:
Nov 2008
Posts:
33
Plugin Contributions:
0

Affiliate program tpl_checkout_success_default issue

I am running Zen-Cart 1.38 with the cherry zen theme. I am currently trying to setup an affiliate program withe shareasale and their instructions want me to put their code in includes/templates/cherry_zen/templates/checkout success/tpl_footer.php

My template does not have this directory so I assume to create it I would have to tell the tpl_checkout_success_default to call this file if I manually create it. Instead I attempted to place their code in the tpl_checkout_success_default.php file. This kind of works as it does return some date to the site, but does not return the order total. I have posted their code below. It looks to me that they are using variables that are not defined or referenced in my php file. I'm not sure but that is an idea. Can anyone see why pasting the code in my checkout_success file wouldn't work or how I could fix it? Obviously I put my merchant number in instead of the xxx

<?php if (isset($zv_orders_id) && (int)$zv_orders_id > 0 && isset($order_summary) && is_array($order_summary)) { if (!isset($_SESSION['affiliate_order_id']) || $_SESSION['affiliate_order_id'] != $zv_orders_id ) { $_SESSION['affiliate_order_id'] = $zv_orders_id; $commissionable_order_formatted = number_format($order_summary['commissionable_order'], 2, '.', ''); echo '<img src="https://shareasale.com/sale.cfm?amount=' . $commissionable_order_formatted . '&tracking=' . $order_summary['order_number'] . '&transtype=sale&merchantID=XXXX" width="1" height="1">'; } } ?>
24 Sep 2009, 2:24 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Affiliate program tpl_checkout_success_default issue

ahall13:

their instructions want me to put their code in includes/templates/cherry_zen/templates/checkout success/tpl_footer.phpCorrect.
ahall13:

My template does not have this directory so I assume to create it I would have to tell the tpl_checkout_success_default to call this file if I manually create it.Incorrect assumption.
Simply create the folder specified, and copy the file specified from the "common" folder of your template, into that folder.
ie: in your case, since you're using "cherry_zen", you would copy /includes/templates/cherry_zen/common/tpl_footer.php to /includes/templates/cherry_zen/checkout_success/tpl_footer.php and make your edits in that file.
ahall13:

It looks to me that they are using variables that are not defined or referenced in my php file.
Perhaps, although what they've given you appears to be largely correct.
The correct variables to use in Zen Cart v1.3.8a are:

  $order_summary['order_number'];
  $order_summary['order_subtotal'];
  $order_summary['credits_applied'];
  $order_summary['order_total'];
  $order_summary['commissionable_order'];
  $order_summary['commissionable_order_formatted'];
  $order_summary['coupon_code'];
24 Sep 2009, 3:30 AM
#3
ahall13 avatar

ahall13

New Zenner

Join Date:
Nov 2008
Posts:
33
Plugin Contributions:
0

Re: Affiliate program tpl_checkout_success_default issue

Thank you for your quick advice. For some reason I copy the tpl_footer.php to my
/includes/templates/cherry_zen/checkout_success/

but when I complete a transaction it does not appear to access this file. I made some minor changes to my new footer file so I could tell instantly if it was using it or the common files footer and it appears to still use the common files tpl_footer.

So this should just work by adding the checkout_success directory to /includes/templates/cherry_zen/ ? I don't need to tell it to point to this file? Perhaps it is case sensitive and all lowercase isn't correct?

24 Sep 2009, 3:31 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: Affiliate program tpl_checkout_success_default issue

ahall13:

So this should just work by adding the checkout_success directory to /includes/templates/cherry_zen/ ?
Yes .

24 Sep 2009, 3:41 AM
#5
ahall13 avatar

ahall13

New Zenner

Join Date:
Nov 2008
Posts:
33
Plugin Contributions:
0

Re: Affiliate program tpl_checkout_success_default issue

I really appreciate your help. Since it isn't looking at the new tpl_footer.php do you have any advice on what I should be looking for? It still looks at the common file tpl_footer even though I created the new one. Any direction is helpful.

Adam

24 Sep 2009, 4:55 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Affiliate program tpl_checkout_success_default issue

Must be something broken in your template.

Put it in your tpl_checkout_success_default.php file instead ... probably best at the bottom.