Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2007
    Posts
    56
    Plugin Contributions
    0

    Default FedEx Xml Heavy Freight Module

    You will need PHP 5. and Curl support,
    to use this FedEX XML rate request PHP script.
    If your Host does not support these,
    I use Camelot Hosting, they are Zen Cart Hosts.
    http://www.camelot-hosting.com/hosting/
    The Con Way XML Rate Quote Requese can be found at,
    FORUM PAGE LINK
    http://www.zen-cart.com/forum/showth...reate+a+module
    These 2 XML scripts must be custom addaped to your requirments.
    -----
    includes/languages/english/modules/shipping/fedex.php
    ----
    <?php
    /*
    Released under the GNU General Public License
    */

    define('MODULE_SHIPPING_FXFREIGHT_TEXT_TITLE', 'FedEx Freight');
    define('MODULE_SHIPPING_FXFREIGHT_TEXT_DESCRIPTION', 'FedEx Freight transports items too large for their regular service.');
    define('MODULE_SHIPPING_FXFREIGHT_TEXT_WAY', 'FedEx Freight');
    define('MODULE_SHIPPING_FXFREIGHT_TEXT_ERROR_BAD_COUNTRY', 'FedEx Freight is only available to customer in the United States and Canada.');
    define('MODULE_SHIPPING_FXFREIGHT_TEXT_ERROR_BAD_RESPONSE', 'FedEx Freight returned an error or invalid response.');
    define('MODULE_SHIPPING_FXFREIGHT_TEXT_ERROR_DESCRIPTION', 'We\'re sorry, but an error occured while calculating the FedEx Freight shipping prices.');
    define('MODULE_SHIPPING_FXFREIGHT_TEXT_ERROR_SHIPPING_WITHIN_CA', 'We\'re sorry, but FedEx Freight\'s estimator does not currently support estimates for shipping from one Canadian address to another.');
    ?>
    --------------------------------------------------------------------------------
    includes/modules/shipping/fedex.php
    -
    <?php
    /*
    Released under the GNU General Public License
    */

    class fxfreight extends base {
    var $code, $title, $description, $icon, $enabled;

    // class constructor
    function fxfreight() {
    global $total_weight, $order, $db, $template;
    $this->code = 'fxfreight';
    $this->title = MODULE_SHIPPING_FXFREIGHT_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_FXFREIGHT_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_FXFREIGHT_SORT_ORDER;
    $this->icon = DIR_WS_IMAGES . 'fedex-images/FREIGHT.gif';
    $this->tax_class = MODULE_SHIPPING_FXFREIGHT_TAX_CLASS;
    $this->enabled = ((MODULE_SHIPPING_FXFREIGHT_STATUS == 'True') ? true : false);

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FXFREIGHT_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FXFREIGHT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
    while (!$check->EOF) {
    if ($check->fields['zone_id'] < 1) {
    $check_flag = true;
    break;
    } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
    $check_flag = true;
    break;
    }
    $check->MoveNext();
    }

    if ($check_flag == false) {
    $this->enabled = false;
    }
    }
    if($this->enabled == true && $order->delivery['country']['iso_code_2']!='US' && $order->delivery['country']['iso_code_2']!='CA') {
    $this->enabled = false;
    }
    $this->shipping_weight = 0;
    $this->shipping_num_boxes = 1;
    if ($this->enabled == true && (is_numeric($total_weight) || $_SESSION['cart']->attributes_1216ft()==true) ) {
    $this->shipping_weight = $total_weight;
    if($this->shipping_weight <= 150 && $_SESSION['cart']->attributes_1216ft()==false) {
    $this->enabled = false;
    return false;
    }
    }

    }

    // class methods
    function quote($method = '') {
    global $total_weight, $zc_large_percent, $zc_large_weight, $shipping_weight, $shipping_num_boxes, $cart, $order;

    $this->shipping_weight = $total_weight;// + ($total_weight*($zc_large_percent/100)) + $zc_large_weight;

    if($this->shipping_weight <= 150 && $_SESSION['cart']->attributes_1216ft()==false) {
    $this->enabled = false;
    return false;
    } else {
    $error_msg = '';

    //First, we get the customer's zipcode and country in the right format.
    $dest_country = $order->delivery['country']['iso_code_2'];

    if ($dest_country == 'US') {
    $dest_zip = preg_replace('/[^0-9]/i', '', strtoupper($order->delivery['postcode']));
    $dest_zip = substr($dest_zip, 0, 5);
    } elseif ($dest_country == 'CA') {
    $dest_zip = preg_replace('/[^0-9A-Z]/i', '', strtoupper($order->delivery['postcode']));
    $dest_zip = substr($dest_zip, 0, 6);
    } else {
    $error_msg = '<br>' . MODULE_SHIPPING_FXFREIGHT_TEXT_ERROR_BAD_COUNTRY;
    }

    //Format the shipping zip code as well
    if (MODULE_SHIPPING_FXFREIGHT_SHIP_COUNTRY == 'US') {
    $ship_zip = preg_replace('/[^0-9]/i', '', MODULE_SHIPPING_FXFREIGHT_SHIP_ZIP);
    $ship_zip = substr($ship_zip, 0, 5);
    } elseif (MODULE_SHIPPING_FXFREIGHT_SHIP_COUNTRY == 'CA') {
    $ship_zip = preg_replace('/[^0-9A-Z]/i', '', strtoupper(MODULE_SHIPPING_FXFREIGHT_SHIP_ZIP));
    $ship_zip = substr($ship_zip, 0, 6);
    }

    if (!zen_not_null($error_msg)) {
    $base_URL = 'http://www.fedexfreight.fedex.com/XMLRating.jsp?';
    $base_URL .= 'as_shipterms=' . MODULE_SHIPPING_FXFREIGHT_SHIP_TERMS;
    $base_URL .= '&as_shzip=' . $ship_zip;
    $base_URL .= '&as_shcntry=' . MODULE_SHIPPING_FXFREIGHT_SHIP_COUNTRY;
    $base_URL .= '&as_cnzip=' . $dest_zip;
    $base_URL .= '&as_cncntry=' . $dest_country;
    $base_URL .= '&as_class1=050';
    $base_URL .= '&as_weight1='.ceil($this->shipping_weight);//urlencode(number_format($this->shipping_weight, 1, '.', ''));
    $base_URL .= '&as_pcs1='.$this->shipping_num_boxes;
    $base_URL .= '&as_iamthe=shipper';

    if (MODULE_SHIPPING_FXFREIGHT_DECLARE_VALUE == 'True') {
    $base_URL .= '&as_decvalue=' . ceil($order->info['subtotal']);//urlencode(number_format($order->info['subtotal'], 2, '.', ''));
    }
    if (MODULE_SHIPPING_FXFREIGHT_RES_DELIVERY == 'True' && !zen_not_null($order->delivery['company'])) {
    $base_URL .= '&as_residentialdelivery=Y';
    }
    if (MODULE_SHIPPING_FXFREIGHT_INS_PICKUP != 'None') {
    $base_URL .= '&as_insidepickup=' . MODULE_SHIPPING_FXFREIGHT_INS_PICKUP;
    }
    if (MODULE_SHIPPING_FXFREIGHT_INS_DELIVERY != 'None') {
    $base_URL .= '&as_insidedelivery='.MODULE_SHIPPING_FXFREIGHT_INS_DELIVERY;
    }
    $base_URL .= '&as_singleshipment=Y';
    $base_URL .= '&as_callbefore='.MODULE_SHIPPING_FXFREIGHT_CBD;
    $base_URL .= '&as_liftgate='.MODULE_SHIPPING_FXFREIGHT_LIFT_GATE;

    $account_Params = '';
    if (trim(MODULE_SHIPPING_FXFREIGHT_ACCT_NUM) != '') {
    $account_Params .= '&as_acctnbr=' . MODULE_SHIPPING_FXFREIGHT_ACCT_NUM;
    }

    //http://www.fedexfreight.fedex.com/XMLRating.jsp?as_shipterms=prepaid&as_shzip=72601&as_shcntry=US&as_cnzip=77306&a s_cncntry=US&as_class1=050&as_weight1=400&as_pcs1=1&as_insidedelivery=IDP&as_cal lbefore=Y&as_iamthe=shipper&as_singleshipment=Y
    $total_shipping_price = 0;
    $ship_price = $this->getFXFQuote($base_URL.$account_Params);

    if (!$ship_price) {
    $ship_price = $this->getFXFQuote($base_URL);
    if (!$ship_price) {
    //Currently, shipping within CA is not supported
    if (MODULE_SHIPPING_FXFREIGHT_SHIP_COUNTRY == 'CA' && $dest_country == 'CA') {
    $error_msg .= '<br>' . MODULE_SHIPPING_FXFREIGHT_TEXT_ERROR_SHIPPING_WITHIN_CA . '<br>';
    } else {
    $error_msg .= '<br>' . MODULE_SHIPPING_FXFREIGHT_TEXT_ERROR_BAD_RESPONSE;// . '<br>' . $base_URL;
    }
    } else {
    $handling_fee = MODULE_SHIPPING_FXFREIGHT_HANDLING;
    if(!zen_not_null($handling_fee)) {
    $handling_fee = 0;
    } elseif(substr($handling_fee, -1) == '%') {
    $handling_fee = ($handling_fee / 100) * $ship_price;
    } elseif($handling_fee > 0 && $handling_fee < 1) {
    $ship_price = $ship_price/$handling_fee;
    $handling_fee = 0;
    }
    $total_shipping_price = $ship_price + $handling_fee;
    }
    } else {
    $handling_fee = MODULE_SHIPPING_FXFREIGHT_HANDLING;
    if(!zen_not_null($handling_fee)) {
    $handling_fee = 0;
    } elseif(substr($handling_fee, -1) == '%') {
    $handling_fee = ($handling_fee / 100) * $ship_price;
    } elseif($handling_fee > 0 && $handling_fee < 1) {
    $ship_price = $ship_price/$handling_fee;
    $handling_fee = 0;
    }
    $total_shipping_price = $ship_price + $handling_fee;
    }
    }//if (!zen_not_null($error_msg)) {

    if (!zen_not_null($error_msg)) {
    $items_1216ft_fee = MODULE_SHIPPING_FXFREIGHT_ITEMS1216FT_FEE;
    $items_1216ft_fee = trim($items_1216ft_fee);
    if(is_numeric($items_1216ft_fee)) {
    if($_SESSION['cart']->attributes_1216ft()==true) $total_shipping_price = $total_shipping_price + MODULE_SHIPPING_FXFREIGHT_ITEMS1216FT_FEE;
    }
    $this->quotes = array('id' => $this->code,
    'module' => '',//MODULE_SHIPPING_FXFREIGHT_TEXT_TITLE,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_FXFREIGHT_TEXT_WAY,
    'cost' => $total_shipping_price)));

    if ($this->tax_class > 0) {
    $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    }

    if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
    } else {
    $this->quotes = array('module' => $this->title,
    'error' => MODULE_SHIPPING_FXFREIGHT_TEXT_ERROR_DESCRIPTION . $error_msg);
    }
    return $this->quotes;
    }
    }

    function getFXFQuote($url) {
    $isError = false;
    $connectMethod = false;

    if (($fp = @fopen($url, "r"))) {
    $connectMethod = 'fopen';
    $data = fread($fp, 4096);
    } elseif (function_exists('curl_init')) {
    $connectMethod = 'curl';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 180);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    $data = curl_exec($ch);
    }
    if ($connectMethod) {
    if (strpos($fp, 'RATINGERROR') === true || strpos($data, '<NetFreightCharges>') === false) {
    return false;
    } else {
    $start_pos = strpos($data, '<NetFreightCharges>') + 20;
    $string_len = strpos($data, '</NetFreightCharges>') - $start_pos;
    $shipping_price = str_replace(',', '', substr($data, $start_pos, $string_len));

    if (is_numeric($shipping_price)) {
    return $shipping_price;
    } else {
    return false;
    }
    }
    } else {
    return false;
    }
    }

    function check() {
    global $db;

    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FXFREIGHT_STATUS'");
    $this->_check = $check_query->RecordCount();
    }

    return $this->_check;
    }

    function install() {
    global $db;
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable FedEx Freight Shipping', 'MODULE_SHIPPING_FXFREIGHT_STATUS', 'True', 'Do you want to offer FedEx Freight shipping?', '6', '10', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shipping Terms', 'MODULE_SHIPPING_FXFREIGHT_SHIP_TERMS', 'prepaid', 'Will these shipments be prepaid or collect? (This is here for future dev. No collect support right now)', '6', '20', 'zen_cfg_select_option(array(\'prepaid\', \'collect\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipper\'s Zip Code', 'MODULE_SHIPPING_FXFREIGHT_SHIP_ZIP', 'zIP cODE', 'Enter the zip code of where these shipments will be sent from. (Required)', '6', '30', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shipper\'s Country', 'MODULE_SHIPPING_FXFREIGHT_SHIP_COUNTRY', 'US', 'Select the country where these shipments will be sent from.', '6', '40', 'zen_cfg_select_option(array(\'US\', \'CA\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Account Number', 'MODULE_SHIPPING_FXFREIGHT_ACCT_NUM', 'aCCOUNT nUMBER', 'If you have a FedEx Freight account number, enter it here. (Optional)', '6', '50', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Declare Shipment Value?', 'MODULE_SHIPPING_FXFREIGHT_DECLARE_VALUE', 'False', 'Do you want to declare the value of the shipments? (the order total will be used)', '6', '60', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Inside Pickup', 'MODULE_SHIPPING_FXFREIGHT_INS_PICKUP', 'None', 'Indicates if this is an inside pickup and the terms (prepaid or collect).', '6', '70', 'zen_cfg_select_option(array(\'None\', \'IPP\', \'IPC\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Inside Delivery', 'MODULE_SHIPPING_FXFREIGHT_INS_DELIVERY', 'None', 'Indicates if this is an inside delivery and the terms (prepaid or collect).', '6', '72', 'zen_cfg_select_option(array(\'None\', \'IDP\', \'IDC\'), ', now())");
    //$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Residential Pickup', 'MODULE_SHIPPING_FXFREIGHT_RES_PICKUP', 'N', 'Will FedEx be picking up the shipments at a residence?', '6', '74', 'zen_cfg_select_option(array(\'Y\', \'N\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Residential Delivery', 'MODULE_SHIPPING_FXFREIGHT_RES_DELIVERY', 'False', 'Enable residential delivery if delivery address has no company name?', '6', '77', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Call Before Delivery', 'MODULE_SHIPPING_FXFREIGHT_CBD', 'N', 'Indicates if notification prior to delivery is required.', '6', '80', 'zen_cfg_select_option(array(\'Y\', \'N\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Lift Gate', 'MODULE_SHIPPING_FXFREIGHT_LIFT_GATE', 'N', 'Will FedEx need a lift gate to pick up the shipments?', '6', '85', 'zen_cfg_select_option(array(\'Y\', \'N\'), ', now())");
    //$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Error Logs', 'MODULE_SHIPPING_FXFREIGHT_ERROR_ACTION', 'Email', 'If FedEx kicks back an error, how do you want to display it? (Email to store owner, display to customer, or none)', '6', '90', 'zen_cfg_select_option(array(\'Email\', \'Display\', \'None\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_FXFREIGHT_HANDLING', '.72', 'Handling fee for this shipping method.', '6', '100', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Items 12/16 FT Fee', 'MODULE_SHIPPING_FXFREIGHT_ITEMS1216FT_FEE', '70.00', 'Handling fee on items 12/16 FT lengths for this shipping method.', '6', '105', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FXFREIGHT_TAX_CLASS', '1', 'Use the following tax class on the shipping fee.', '6', '110', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FXFREIGHT_ZONE', '6', 'If a zone is selected, only enable this shipping method for that zone.', '6', '120', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_FXFREIGHT_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '130', now())");
    }

    function remove() {
    global $db;
    $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
    return array('MODULE_SHIPPING_FXFREIGHT_STATUS', 'MODULE_SHIPPING_FXFREIGHT_SHIP_TERMS', 'MODULE_SHIPPING_FXFREIGHT_SHIP_ZIP', 'MODULE_SHIPPING_FXFREIGHT_SHIP_COUNTRY', 'MODULE_SHIPPING_FXFREIGHT_ACCT_NUM', 'MODULE_SHIPPING_FXFREIGHT_INS_PICKUP', 'MODULE_SHIPPING_FXFREIGHT_INS_DELIVERY', 'MODULE_SHIPPING_FXFREIGHT_CBD', 'MODULE_SHIPPING_FXFREIGHT_DECLARE_VALUE', 'MODULE_SHIPPING_FXFREIGHT_RES_DELIVERY', 'MODULE_SHIPPING_FXFREIGHT_LIFT_GATE', 'MODULE_SHIPPING_FXFREIGHT_HANDLING', 'MODULE_SHIPPING_FXFREIGHT_ITEMS1216FT_FEE', 'MODULE_SHIPPING_FXFREIGHT_TAX_CLASS', 'MODULE_SHIPPING_FXFREIGHT_ZONE', 'MODULE_SHIPPING_FXFREIGHT_SORT_ORDER');
    }
    }
    ?>

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

    Default Re: FedEx Xml Heavy Freight Moduel

    Con Way Freight Rate Quote Moduel is available on this link.
    http://www.zen-cart.com/forum/showth...reate+a+module

    Con Way ships to Canada

  3. #3
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default Re: FedEx Xml Heavy Freight Module

    Relentless,

    This is not working as copied-pasted into the appropriate .php files. Random spaces are being inserted (probably browser issues?).

    It would be much better to post these in the downloads section.

    This code is tested and working? As is I am unable to even get this to come up under the admin -> modules -> shipping modules area ???

    -chaddro

  4. #4
    Join Date
    Sep 2007
    Posts
    56
    Plugin Contributions
    0

    Default Re: FedEx Xml Heavy Freight Module

    It has been requested in the Zen Cart Forum that,
    the two heavy freight modules, for Freight over 150lbs.
    Due to copying from the forum errors [blank spaces etc.] that,
    FedEx and Con Way be posted in the Downloads section of Zen Cart.
    I now feel that they are complete modules.
    Register with the Freight company, and use.
    I think that someone,
    should test them to see, that they will load properly to the, Admin. ,
    and the [get shipping quote form], when activated. Also to look at the code.
    Remember that they come from a working web site.
    I would post them, but I think that testing first is needed,
    and I could not support them, for obvious lack of PHP skill..
    If you feel you can support these files PM me
    your email address.
    I will email you the files.

  5. #5
    Join Date
    Sep 2007
    Posts
    56
    Plugin Contributions
    0

    Default Re: FedEx Xml Heavy Freight Module

    I installed the 2 FedEx Heavy Freight files,
    in my carts server.
    They installed correctly no quote yet.
    Will work it out with FedEx.
    Correct install in admin. were half way home,
    What could go wrong.
    Relentless

  6. #6
    Join Date
    Sep 2007
    Posts
    56
    Plugin Contributions
    0

    Default Re: FedEx Xml Heavy Freight Module

    When I click Check Out with FedEx Freight module I get these 2 warnings
    ----
    Warning: Cannot modify header information -
    1]headers already sent by (output started at
    /home2/aircscom/public_html/includes/modules/shipping/fxfreight.php:277)
    There are only 260 lines of code in fxfreight.php,
    so this must be just the source of the Warning: Cannot modify header information
    ----
    2]in /home2/aircscom/public_html/includes/functions/functions_general.php on line 44
    -----
    From functions_general.php
    // clean up URL before executing it
    while (strstr($url, '&&')) $url = str_replace('&&', '&', $url);
    while (strstr($url, '&amp;&amp;')) $url = str_replace('&amp;&amp;', '&amp;', $url);
    //header locates should not have the &amp; in the address it breaks things
    while (strstr($url, '&amp;')) $url = str_replace('&amp;', '&', $url);
    /*line 44*/ header('Location: ' . $url);
    zen_exit();
    //this it the action of line 44:
    //void header (string string, bool replace, int_responce_code)send raw http header

    ------
    From fxfreight.php line 94 is this warning refering to the & in &as
    94]if (!zen_not_null($error_msg)) {
    $base_URL = 'http://www.fedexfreight.fedex.com/XMLRating.jsp?';
    $base_URL .= 'as_shipterms=prepaid' . MODULE_SHIPPING_FXFREIGHT_SHIP_TERMS;
    $base_URL .= '&as_shzip=33173' . $ship_zip;
    $base_URL .= '&as_shcntry=US' . MODULE_SHIPPING_FXFREIGHT_SHIP_COUNTRY;
    $base_URL .= '&as_cnzip=' . $dest_zip;
    $base_URL .= '&as_cncntry=' . $dest_country;
    $base_URL .= '&as_class1=077';
    $base_URL .= '&as_weight1='.ceil($this->shipping_weight);
    //urlencode(number_format($this->shipping_weight, 1, '.', ''));
    $base_URL .= '&as_pcs1='.$this->shipping_num_boxes;
    $base_URL .= '&as_iamthe=shipper';


    The fxfreight.php code posted in this thread,
    does not install, with out modification.
    Now with modification it installs disabled, yellow indicator in Admin..
    We are close to a working Module
    Thank You
    Relentless

  7. #7
    Join Date
    Sep 2007
    Posts
    56
    Plugin Contributions
    0

    Default Re: FedEx Xml Heavy Freight Module

    I have made real progress, I have gotten to page 2of3 of check out
    In the FedEx module there is an ->attributes_1216ft()
    for people who for example ship step ladders
    I need to get rid of ->attributes_1216ft() this is causing the errors,
    it was the first error, and continues,
    and I do not need it for a freight quote
    ====A possible solution starts->
    At the beginning of the quote() function, it defines $cart as a global variable.
    And it expects it to be an array passed from the calling function eg. $_SESSION['cart'].
    So if this is array is not passed to it, it is always going to blow up.
    So a one line fix to the whole problem would be
    to set attributes_1216=0 in the module file that calls quote().
    then no fxfreight.php function file changes would be necessary at all.
    Can you help
    I have the php to remove ->attributes_1216ft() from the mod,
    but this seems a better solution.

  8. #8

    Default Re: FedEx Xml Heavy Freight Module

    this module was custom coded for my site (and i know it was because had him add 12/16 ft. lengths) and apparently somebody ripped it off and is distributing it.

  9. #9
    Join Date
    Jan 2010
    Posts
    42
    Plugin Contributions
    0

    Default Re: FedEx Xml Heavy Freight Module

    Does anyone have a working fedex freight quote module?

  10. #10
    Join Date
    May 2007
    Location
    Des Moines, IA
    Posts
    19
    Plugin Contributions
    1

    Default Re: FedEx Xml Heavy Freight Module

    I also would like to find a working FedEx Freight module.

    CheapStairParts,

    Sorry about your custom work showing up here. That's a shame. Who did you have do the coding? I'm not suggesting they released it, but I might see if they'll give me a quote for a working module like you have for your Zen Cart.

    Thanks,

    John

 

 

Similar Threads

  1. what module do I use for Fedex freight LTL ?
    By brianthomas in forum Addon Shipping Modules
    Replies: 2
    Last Post: 17 Sep 2011, 10:25 PM
  2. Con-Way Heavy Freight Custom Module
    By Relentless in forum Addon Shipping Modules
    Replies: 15
    Last Post: 15 Mar 2011, 11:52 PM
  3. UPS Heavy Freight Module UPS Freight over 150 lbs.
    By Relentless in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 13 Jan 2011, 12:10 AM
  4. Fedex Freight Module ported from OsCommerce
    By chadderuski in forum Addon Shipping Modules
    Replies: 19
    Last Post: 16 May 2008, 04:50 PM
  5. Fedex Freight Module?
    By CheapStairParts in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 18 Dec 2007, 11:12 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