Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2007
    Posts
    77
    Plugin Contributions
    0

    Default Candapost Desktop EST Export module - does not export

    Hello,

    I am using Zen-Cart 1.37. I installed the Canadapost Destop EST Export module which should export a cvs file with the customer addresses of a selected range of orders.

    However when I click on the "Generate" button nothing happens.

    The main code file is pasted here, maybe somebody can give me a clue of what's missing from here. I should be pointed to save the file - but none of that happens:

    Code:
    <?php
    // GPL license - see license.txt
    
      require('includes/application_top.php');
    
      // csv settings
      define("CSV_SEPARATOR", ",");
      define("CSV_NEWLINE", "\r\n");
    
    // not submitted, so show form to submit
    if (!$submitted || $submitted != 1)
    {
    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
    <title><?php echo TITLE; ?></title>
    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
    <script language="javascript" src="includes/menu.js"></script>
    <script language="javascript" src="includes/general.js"></script>
    <script type="text/javascript">
      <!--
      function init()
      {
        cssjsmenu('navbar');
        if (document.getElementById)
        {
          var kill = document.getElementById('hoverJS');
          kill.disabled = true;
        }
      }
      // -->
    </script>
    </head>
    <body onload="init()">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
    <!-- header_eof //-->
    
    <!-- body //-->
    <table border="0" width="100%" cellspacing="2" cellpadding="2">
      <tr>
    <td>
      <div class="pageHeading"><?php echo HEADING_TITLE; ?></div>
    
      <form method="GET" action="<?php echo $PHP_SELF; ?>">
      <table border="0" cellpadding="3">
      <tr>
        <td><?php echo TEXT_START_ORDER_NUM; ?></td>
        <td><input name="start" size="5" value="<?php echo $start; ?>">
      </tr>
      <tr>
        <td><?php echo TEXT_END_ORDER_NUM; ?></td>
        <td><input name="end" size="5" value="<?php echo $end; ?>">
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="submit" value="<?php echo BUTTON_GENERATE; ?>"></td>
      </tr>
      </table>
      <input type="hidden" name="submitted" value="1">
      </form>
    
    </td>
      </tr>
    </table>
    <!-- body_eof //-->
    
    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
    <!-- footer_eof //-->
    </body>
    </html>
    <?php
    }
    // submitted so generate csv
    else
    {
      generatecsv($start, $end);
    }
    
    // generates csv file from $start order to $end order, inclusive
    function generatecsv($start, $end)
    {
      global $db;
    
      $sql =  "SELECT * ";
      $sql .= "FROM " . TABLE_ORDERS . " ";
      $sql .= "WHERE orders_id >= $start
               AND   orders_id <= $end";
    
      $orders = $db->Execute($sql);
    
      header("Pragma: cache");
      header("Content-Type: text/comma-separated-values");
      header("Content-Disposition: attachment; filename=" . FILENAME_CANADA_POST_DESKTOP_EST_EXPORT_DATA);
      
    
      while (!$orders->EOF)
      {
        echo quote(2).CSV_SEPARATOR;
        echo quote($orders->fields['orders_id']).CSV_SEPARATOR;
        echo quote($orders->fields['customers_id']).CSV_SEPARATOR;
        echo quote(NULL).CSV_SEPARATOR;
        echo quote($orders->fields['delivery_name']).CSV_SEPARATOR;
        echo quote(NULL).CSV_SEPARATOR;
        echo quote(NULL).CSV_SEPARATOR;
        echo quote($orders->fields['delivery_company']).CSV_SEPARATOR;
        echo quote(NULL).CSV_SEPARATOR;
        echo quote($orders->fields['delivery_street_address']).CSV_SEPARATOR;
        echo quote($orders->fields['delivery_suburb']).CSV_SEPARATOR;
        echo quote($orders->fields['delivery_city']).CSV_SEPARATOR;
        echo quote($orders->fields['delivery_state']).CSV_SEPARATOR;
        echo quote($orders->fields['delivery_postcode']).CSV_SEPARATOR;
        echo quote($orders->fields['delivery_country']).CSV_SEPARATOR;
        echo quote($orders->fields['customers_telephone']).CSV_SEPARATOR;
        echo quote(NULL).CSV_SEPARATOR;
        echo quote($orders->fields['customers_email_address']).CSV_SEPARATOR;
        echo quote(0).CSV_NEWLINE;
    
        $orders->MoveNext();
      }
    }
    
    // returns the name for a shipping status
    function getorderstatus($statusid)
    {
      global $db;
    
      $query = "select * from " . TABLE_ORDERS_STATUS . " where orders_status_id = $statusid";
    
      $statii = $db->Execute($query);
    
      while (!$statii->EOF)
      {
        return $statii->fields['orders_status_name'];
      }
    
      return $statusid;
    }
    
    // formats a value suitable for including in a csv file
    function quote($value)
    {
      // if quote mark in string then escape with another quote mark
      // then put in quote marks and return
      if (strstr($value, "\"") !== FALSE)
      {
        $value = ereg_replace("\"", "\"\"", $value);
        return "\"$value\"";
      }
    
      // if seperator in string then put in quote marks
      if (strstr($value, CSV_SEPARATOR) !== FALSE)
      {
        return "\"$value\"";
      }
    
      return $value;
    }
    
    require(DIR_WS_INCLUDES . 'application_bottom.php');
    
    ?>

  2. #2
    Join Date
    Sep 2007
    Posts
    77
    Plugin Contributions
    0

    Default Re: Candapost Desktop EST Export module - does not export

    Nobody has any idea?

 

 

Similar Threads

  1. v150 Canada Post Desktop EST Export Not showing up in Admin
    By chrismjgallant in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 2 May 2016, 08:58 PM
  2. Sage Line 50 Zen export module
    By Calljj in forum All Other Contributions/Addons
    Replies: 78
    Last Post: 15 Jan 2013, 11:07 AM
  3. Export email module
    By eddy_r3 in forum Basic Configuration
    Replies: 4
    Last Post: 18 May 2012, 07:08 PM
  4. Trouble with Export Shipping Information Module
    By kinget in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 22 Dec 2008, 07:03 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR