Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2008
    Posts
    38
    Plugin Contributions
    0

    Default 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">';
    }
    }
    ?>

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Affiliate program tpl_checkout_success_default issue

    Quote Originally Posted by ahall13 View Post
    their instructions want me to put their code in includes/templates/cherry_zen/templates/checkout success/tpl_footer.php
    Correct.
    Quote Originally Posted by ahall13 View Post
    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.
    Quote Originally Posted by ahall13 View Post
    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:
    Code:
      $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'];
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Nov 2008
    Posts
    38
    Plugin Contributions
    0

    Default 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?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Affiliate program tpl_checkout_success_default issue

    Quote Originally Posted by ahall13 View Post
    So this should just work by adding the checkout_success directory to /includes/templates/cherry_zen/ ?
    Yes .
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Nov 2008
    Posts
    38
    Plugin Contributions
    0

    Default 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

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default 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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. JROX Affiliate Program NOT recording Affiliate Sales
    By PhysiqueBoutique in forum General Questions
    Replies: 6
    Last Post: 17 Oct 2008, 10:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg