Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Help with custom code on checkout success page (iDevAffiliate)

    I am trying to install iDevAffiliate on my shop. The program itself seems to work correctly, but when I install the tracking code on the checkout success header, it makes the font on my checkout success page HUGE. I have no idea why it would do this. I'm wondering if there are any php gurus out there that can take a look at the code and see if there is something that might be wrong?

    These are their instructions:

    Edit this file: /zencart/includes/modules/pages/checkout_success/header_php.php.

    Find the following code which already exists in the file.

    PHP Code:
    $zv_orders_id $orders->fields['orders_id']; 
    That code actually doesn't exist in my header file... So I added their code beneath "$orders_id = $zv_orders_id;"



    This is the code they provide to insert:

    PHP Code:
    $idev $db->Execute("select * from " TABLE_ORDERS_TOTAL " where orders_id = '".(int)$orders->fields['orders_id']."' AND class = 'ot_subtotal'");
    $idev_saleamt = (number_format($idev->fields['value'],2));
    $idev_ordernum $idev->fields['orders_id'];
    print 
    "<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://www.saffireblue.ca/idevaffiliate/sale.php?profile=13&idev_saleamt=$idev_saleamt&idev_ordernum=$idev_ordernum\"></script>"
    I can't figure out why it would ignore my css font size and make the font so huge...?

    I tried adding #checkoutsuccessBody to my checkout_success.css, but it seems to ignore that too. Anyone have any ideas?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    We need to see the site live to diagnose styling issues. If the problem only happens on the checkout_success page, we would need to complete a transaction. Do you have check/money order enabled so we could do a test "purchase" without actually paying?

    Also, if they say that a certain bit of code exists in a file and it doesn't, you should ask them for clarification. This one doesn't seem like it ought to matter for placement, but you never know.

  3. #3
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    I did submit a ticket with iDev, but they aren't open for another 1/2 hour and their estimated wait time is 8 hours. So hopefully they'll respond to me as well.

    Here's a link to my site. The only problem is that I can't leave the iDev code installed unless I know when you are going to be testing. I can't leave it live for customers to see the screwy success page... LOL

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    Do you have the affiliate code active now? I just "ordered" a book and don't see anything out of the ordinary, except that there is a bit of stray HTML at the bottom of the page:

    Please direct any questions you have to customer service.
    Thanks for shopping with us online!
    " width="1" height="1">

  5. #5
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    No, I don't have it active now. I had inserted their generic pixel tracking code on that page instead, but obviously screwed it up, since it was leaving that width/height hanging. LOL

    I will add the code now if you can test within the next few minutes...

  6. #6
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    Ok, give it a try now....

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    View source for the page shows this
    Code:
    <h3 id="checkoutSuccessThanks" class="centeredContent">Thanks for shopping with us online!</h3>
    
    <img border="0" src="http://www.saffireblue.ca/idevaffiliate/sale.php?profile=72198&idev_saleamt=15.95&idev_ordernum=11195">" width="1" height="1">
    
    
    <!-- Google Code for Order Submit Conversion Page -->
    with the img tag prematurely closed.

    What browser are you using? Firefox handles this HTML error by just showing the leftover as text, but all browsers handle errors differently.

  8. #8
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    Yes, I just removed that code. Can you try reloading the success page now?

  9. #9
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    So I'm looking at the source, and it seems to put the iDev javascript before the opening <html> code...

    Code:
    <script language="JavaScript" type="text/javascript" src="https://www.xxxxx.com/idevaffiliate/sale.php?profile=13&idev_saleamt=3.60&idev_ordernum=9503"></script><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
    <head>
    Hmmmm. That must be what's causing the page to be screwy... but how to fix it, I dunno. LOL

  10. #10
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Help with custom code on checkout success page (iDevAffiliate)

    I just removed the code, so it will look normal now. But here's what my header file looked like....

    Code:
    <?php
    /**
     * checkout_success header_php.php
     *
     * @package page
     * @copyright Copyright 2003-2010 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: header_php.php 16909 2010-07-15 20:02:37Z drbyte $
     */
    
    // This should be first line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_SUCCESS');
    
    // if the customer is not logged on, redirect them to the shopping cart page
    if (!$_SESSION['customer_id']) {
      zen_redirect(zen_href_link(FILENAME_TIME_OUT));
    }
    
    if (!isset($_GET['action']) || (isset($_GET['action']) && $_GET['action'] != 'confirm')) {
    
    $notify_string='';
    if (isset($_GET['action']) && ($_GET['action'] == 'update')) {
      $notify_string = 'action=notify&';
      $notify = $_POST['notify'];
    
      if (is_array($notify)) {
        for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
          $notify_string .= 'notify[]=' . $notify[$i] . '&';
        }
        if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1);
      }
      if ($notify_string == 'action=notify&') {
          zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
      } else {
        zen_redirect(zen_href_link(FILENAME_DEFAULT, $notify_string));
      }
    }
    
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    $breadcrumb->add(NAVBAR_TITLE_1);
    $breadcrumb->add(NAVBAR_TITLE_2);
    
    // find out the last order number generated for this customer account
    $orders_query = "SELECT * FROM " . TABLE_ORDERS . "
                     WHERE customers_id = :customersID
                     ORDER BY date_purchased DESC LIMIT 1";
    $orders_query = $db->bindVars($orders_query, ':customersID', $_SESSION['customer_id'], 'integer');
    $orders = $db->Execute($orders_query);
    $orders_id = $orders->fields['orders_id'];
    
    
    // use order-id generated by the actual order process
    // this uses the SESSION orders_id, or if doesn't exist, grabs most recent order # for this cust (needed for paypal et al).
    // Needs reworking in v1.4 for checkout-rewrite
    $zv_orders_id = (isset($_SESSION['order_number_created']) && $_SESSION['order_number_created'] >= 1) ? $_SESSION['order_number_created'] : $orders_id;
    $orders_id = $zv_orders_id;
    
    //BEGIN IDEV CODE
    $idev = $db->Execute("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '".(int)$orders->fields['orders_id']."' AND class = 'ot_subtotal'");
    $idev_saleamt = (number_format($idev->fields['value'],2));
    $idev_ordernum = $idev->fields['orders_id'];
    print "<script language=\"JavaScript\" type=\"text/javascript\" src=\"https://www.XXXX.com/idevaffiliate/sale.php?profile=13&idev_saleamt=$idev_saleamt&idev_ordernum=$idev_ordernum\"></script>";
    //END IDEV CODE
    
    $order_summary = $_SESSION['order_summary'];
    unset($_SESSION['order_summary']);
    unset($_SESSION['order_number_created']);
    
    
    
    // prepare list of product-notifications for this customer
    $global_query = "SELECT global_product_notifications
                     FROM " . TABLE_CUSTOMERS_INFO . "
                     WHERE customers_info_id = :customersID";
    
    $global_query = $db->bindVars($global_query, ':customersID', $_SESSION['customer_id'], 'integer');
    $global = $db->Execute($global_query);
    $flag_global_notifications = $global->fields['global_product_notifications'];
    
    if ($flag_global_notifications != '1') {
    
      $products_array = array();
      $counter = 0;
    
      $products_query = "SELECT products_id, products_name
                         FROM " . TABLE_ORDERS_PRODUCTS . "
                         WHERE orders_id = :ordersID
                         ORDER BY products_name";
    
      $products_query = $db->bindVars($products_query, ':ordersID', $orders_id, 'integer');
      $products = $db->Execute($products_query);
    
      while (!$products->EOF) {
        $notificationsArray[] = array('counter'=>$counter,
                                      'products_id'=>$products->fields['products_id'],
                                      'products_name'=>$products->fields['products_name']);
        $counter++;
        $products->MoveNext();
      }
    }
    
      $flag_show_products_notification = (CUSTOMERS_PRODUCTS_NOTIFICATION_STATUS == '1' and sizeof($notificationsArray)>0 and $flag_global_notifications != '1') ? true : false ;
    
      $products_displayed = array();
    
    
      $gv_query = "SELECT amount
                   FROM " . TABLE_COUPON_GV_CUSTOMER . "
                   WHERE customer_id = :customersID ";
    
      $gv_query = $db->bindVars($gv_query, ':customersID', $_SESSION['customer_id'], 'integer');
      $gv_result = $db->Execute($gv_query);
    
      if ($gv_result->fields['amount'] > 0 ) {
        $customer_has_gv_balance = true;
        $customer_gv_balance = $currencies->format($gv_result->fields['amount']);
      }
    
    
    // include template specific file name defines
    $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_CHECKOUT_SUCCESS, 'false');
    
    } else {
      echo '<html><head>';
      echo '<script type="text/javascript">
    <!--
    theTimer = 0;
    timeOut = 12;
    
    function submit_form()
    {
      theTimer = setTimeout("submit_form();", 100);
      if (timeOut > 0) {
        timeOut -= 1;
      }
      else
      {
        clearTimeout(theTimer);
        document.getElementById("submitbutton").disabled = true;
        document.forms.formpost.submit();
      }
    }
    function continueClick()
    {
      clearTimeout(theTimer);
      return true;
    }
    
    submit_form();
    //-->
    </script>' . "\n" . '</head>';
      echo '<body style="text-align: center; min-width: 600px;">' . "\n" . '<div style="text-align: center;  width: 600px;  margin-left: auto;  margin-right: auto; margin-top:20%;"><p>This page will automatically redirect you back to ' . STORE_NAME . ' for your order confirmation details.<br />If you are not redirected within 5 seconds, please click the button below to continue.</p>';
      echo "\n" . '<form action="' . zen_href_link(FILENAME_CHECKOUT_SUCCESS, zen_get_all_get_params(array('action')), 'SSL', false) . '" method="post" name="formpost" />' . "\n";
      reset($_POST);
      while (list($key, $value) = each($_POST)) {
        if (!is_array($_POST[$key])) {
          echo zen_draw_hidden_field($key, htmlspecialchars(stripslashes($value))) . "\n";
        }
      }
      echo "\n" . '<input type="submit" class="submitbutton" id="submitbutton" value=" Continue " onclick="continueClick()" />' . "\n";
      echo '</form></div></body></html>';
      exit();
    }
    
    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_SUCCESS');
    Last edited by abcisme; 20 Jul 2012 at 05:18 PM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 23 Feb 2010, 01:21 PM
  2. php error message for my checkout success page that I need help with
    By Markp001 in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 5 Jul 2009, 07:53 PM
  3. Need help with code for direct product links for iDevAffiliate
    By rlfreshwater in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 20 Jan 2009, 02:22 PM
  4. Sales tracking code for checkout success, please help!
    By boinkit in forum General Questions
    Replies: 0
    Last Post: 6 Mar 2008, 06:08 PM

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