Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

FEDEX WSDL for v3 to v2.2


stephan519

Recommended Posts

Hi everyone

I'm beginner in Oscommerce and I try to re write the addon FEDEX WSDL

below my code

<?php

class fedex_module{
var $code, $title, $description, $icon, $enabled;

//Class Constructor
function fedex_module()
{
	global $order;
	 global $customer_id;

	$this->code 			= "fedex";
	$this->title 			= MODULE_SHIPPING_FEDEX_TEXT_TITLE;
	$this->description		= MODULE_SHIPPING_FEDEX_TEXT_DESCRIPTION;
	$this->sort_order		= MODULE_SHIPPING_FEDEX_SORT_ORDER;
	 $this->icon = DIR_WS_ICONS . 'shipping_FEDEX.gif';
	//$this->icon				= '';
	$this->enabled			= ((MODULE_SHIPPING_FEDEX_STATUS == 'True') ? true : false);
	$this->fedex_key		= MODULE_SHIPPING_FEDEX_KEY;
	$this->fedex_pwd		= MODULE_SHIPPING_FEDEX_PWD;
	$this->fedex_act_num	= MODULE_SHIPPING_FEDEX_ACT_NUM;
	$this->fedex_meter_num	= MODULE_SHIPPING_FEDEX_METER_NUM;

}

//Class Methods

function quote($method = '')
{
global $HTTP_POST_VARS, $shipping_address, $shipping_weight;
/* FedEx integration starts */
 global $customer_id;
 ini_set("soap.wsdl_cache_enabled", "0");

require_once('library/fedex-common.php');

$path_to_wsdl = "http://wilanneconcept.com/catalog/includes/modules/shipping/wsdl/RateService_v6.wsdl";

$client = new SoapClient($path_to_wsdl, array('trace' => 1));

if ($customer_id) {

//customer  Details
$customers_query = tep_db_query("select customers_default_address_id from customers WHERE customers_id='" . (int)$customer_id . "'");
   $customers = tep_db_fetch_array($customers_query);
$customers_default_address_id=$customers['customers_default_address_id'];

 $address_query = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customers_default_address_id . "'");
	$address = tep_db_fetch_array($address_query);

 $street_address=$address['street_address'];
 $city=$address['city'];
 $state=$address['state'];
 $postcode=$address['postcode'];
 $country_id=$address['country_id'];
 $zone_id=$address['zone_id'];
 if($state==""){

	$address_format_query1 = tep_db_query("select zone_code from zones where zone_country_id = '" . (int)$country_id . "' AND zone_id='" . (int)$zone_id . "' ");
	$address_format1 = tep_db_fetch_array($address_format_query1);
    $state=$address_format1['zone_code'];
 }

 //echo "select countries_iso_code_2 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'";
 $address_format_query = tep_db_query("select countries_iso_code_2 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
	if (tep_db_num_rows($address_format_query)) {
	  $address_format = tep_db_fetch_array($address_format_query);
	  $CountryCode= $address_format['countries_iso_code_2'];

	 }
}
$request['WebAuthenticationDetail'] = array('UserCredential' =>
                                     array('Key' => 'kCqAfLSan3bsYPS7', 'Password' => 'DyLMbU072eIFjVcDVDjrTm36n')); // Replace 'XXX' and 'YYY' with FedEx provided credentials 
$request['ClientDetail'] = array('AccountNumber' => '510087925', 'MeterNumber' => '100006239');// Replace 'XXX' with your account and meter number

$request['TransactionDetail'] = array('CustomerTransactionId' => ' *** Rate Request v6 using PHP ***');
$request['Version'] = array('ServiceId' => 'crs', 'Major' => '6', 'Intermediate' => '0', 'Minor' => '0');
//$request['ReturnTransitAndCommit'] = true;
$request['RequestedShipment']['DropoffType'] = 'REQUEST_COURIER'; // valid values REGULAR_PICKUP, REQUEST_COURIER, ...
$request['RequestedShipment']['ShipTimestamp'] = date('c');
//$request['RequestedShipment']['ServiceType'] = 'PRIORITY_OVERNIGHT'; // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ...
$request['RequestedShipment']['PackagingType'] = 'YOUR_PACKAGING'; // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ...	
$request['RequestedShipment']['Shipper'] = array('Address' => array(
                                         'StreetLines' => array('10 Fed Ex Pkwy'), // Origin details
                                         'City' => 'ENTRAIGUE SUR SORGUE',
                                         'StateOrProvinceCode' => '',
                                         'PostalCode' => '84320',
                                         'CountryCode' => 'FR'));


$request['RequestedShipment']['Recipient'] = array('Address' => array (
                                              'StreetLines' => array('13450 Farmcrest Ct'), // Destination details
                                              'City' => 'Herndon',
                                              'StateOrProvinceCode' => 'VA',
                                              'PostalCode' => '20171',
                                              'CountryCode' => 'US'));
//print_r($request['RequestedShipment']['Recipient'])	;
//exit;									   
$request['RequestedShipment']['ShippingChargesPayment'] = array('PaymentType' => 'SENDER',
                                                      'Payor' => array('AccountNumber' => '510087925', // Replace 'XXX' with payor's account number
                                                                    'CountryCode' => 'FR'));
$request['RequestedShipment']['RateRequestTypes'] = 'ACCOUNT'; 
$request['RequestedShipment']['RateRequestTypes'] = 'LIST'; 
$request['RequestedShipment']['PackageCount'] = '1';
$request['RequestedShipment']['PackageDetail'] = 'INDIVIDUAL_PACKAGES';
$request['RequestedShipment']['RequestedPackages'] = array('0' => array('SequenceNumber' => '1',
                                                                 'InsuredValue' => array('Amount' => 20.0,
                                                                                         'Currency' => 'EUR'),
                                                                 'ItemDescription' => 'College Transcripts',
                                                                 'Weight' => array('Value' => 2.0,
                                                                                   'Units' => 'KG'),
                                                                 'Dimensions' => array('Length' => 25,
                                                                                       'Width' => 10,
                                                                                       'Height' => 10,
                                                                                       'Units' => 'IN'),
                                                                 'CustomerReferences' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE',
                                                                                                'Value' => 'Undergraduate application')));
	/**/

/**/		
try 
{
	$response = $client ->getRates($request);

	if ($response -> HighestSeverity != 'FAILURE' && $response -> HighestSeverity != 'ERROR')
	{

		//echo 'Rates for following service type(s) were returned.'. $newline. $newline; 

		foreach ($response -> RateReplyDetails as $rateReply)
		{           

		   $title="";
		   /* FedEx integration ends */

			  global $order;

			  if($rateReply -> ServiceType=='FIRST_OVERNIGHT'){
			    $title= "First OverNight";
			  }else if($rateReply -> ServiceType=='PRIORITY_OVERNIGHT'){
			    $title= "Priority OverNight";
			  }else if($rateReply -> ServiceType=='STANDARD_OVERNIGHT'){
			    $title= "Standard OverNight";
			  }else if($rateReply -> ServiceType=='FEDEX_2_DAY'){
			    $title= "2nd Day";
			  }else if($rateReply -> ServiceType=='FEDEX_EXPRESS_SAVER'){
			    $title= "Express Saver";
			  }else if($rateReply -> ServiceType=='FEDEX_GROUND'){
			    $title= "Ground";
			  }else if($rateReply -> ServiceType=='EUROPE_FIRST_INTERNATIONAL_PRIORITY'){
			    $title= "Europe first international priority";
			  }else if($rateReply -> ServiceType=='FEDEX_1_DAY_FREIGHT'){
			    $title= "Fedex 1 day freight";
			  }else if($rateReply -> ServiceType=='FEDEX_2_DAY_FREIGHT'){
			    $title= "Fedex 2 day freight";
			  }else if($rateReply -> ServiceType=='FEDEX_3_DAY_FREIGHT'){
			    $title= "Fedex 3 day freight";
			  }else if($rateReply -> ServiceType=='GROUND_HOME_DELIVERY'){
			    $title= "Fedex ground home delivery";
			  }else if($rateReply -> ServiceType=='INTERNATIONAL_DISTRIBUTION_FREIGHT'){
			    $title= "International distribution freight";
			  }else if($rateReply -> ServiceType=='INTERNATIONAL_ECONOMY'){
			    $title= "International economy";
			  }else if($rateReply -> ServiceType=='INTERNATIONAL_ECONOMY_DISTRIBUTION'){
			    $title= "International economy distribution";
			  }else if($rateReply -> ServiceType=='INTERNATIONAL_ECONOMY_FREIGHT'){
			    $title= "International economy freight";
			  }else if($rateReply -> ServiceType=='INTERNATIONAL_FIRST'){
			    $title= "International first";
			  }else if($rateReply -> ServiceType=='INTERNATIONAL_PRIORITY'){
			    $title= "International priority";
			  }else if($rateReply -> ServiceType=='INTERNATIONAL_PRIORITY_DISTRIBUTION'){
			    $title= "International priority distribution";
			  }else if($rateReply -> ServiceType=='INTERNATIONAL_PRIORITY_FREIGHT'){
			    $title= "International priority freight";
			  }else if($rateReply -> ServiceType=='SMART_POST'){
			    $title= "Smart post";
			  }else if($rateReply -> ServiceType=='FEDEX_FREIGHT'){
			    $title= "Fedex freight";
			  }else if($rateReply -> ServiceType=='FEDEX_NATIONAL_FREIGHT'){
			    $title= "Fedex national freight";
			  }


			//  $methods[]=array('id' => $this->code,
			//				  'title' =>$title,
			//				  'cost' => $rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount);

		$methods[]=array('id' => $rateReply -> ServiceType,
							  'title' =>$title,
							  'cost' => $rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount);

		}




		$this->quotes=array('id' => $this->code,
									'module' => 'FedEx',
									'methods' => $methods); 





		return $this->quotes ;
		//printRequestResponse($client);

	}
	else
	{
		echo 'Error in processing transaction.'. $newline. $newline; 
		foreach ($response -> Notifications as $notification)
		{           
			if(is_array($response -> Notifications))
			{              
			   echo $notification -> Severity;
			   echo ': ';           
			   echo $notification -> Message . $newline;
			}
			else
			{
				echo $notification . $newline;
			}
		} 
	} 


	writeToLog($client);    // Write to log file   

} catch (SoapFault $exception) {
   printFault($exception, $client);        
}								/**/															 


}


function check()
{
if(!isset($this->_check))
{
	$check_query  = tep_db_query("SELECT configuration_value FROM ". TABLE_CONFIGURATION ." WHERE configuration_key = 'MODULE_SHIPPING_FEDEX_STATUS'");
	$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}

function install()
{
tep_db_query("INSERT INTO ". TABLE_CONFIGURATION ." (configuration_title,configuration_key,configuration_value,configuration_descrip
tion,configuration_group_id,
sort_order,set_function,date_added) VALUES ('Enable FedEx Shipping','MODULE_SHIPPING_FEDEX_STATUS','True','Dou you want to offer FedEx shipping?','6','0',
'tep_cfg_select_option(array(\'True\',\'False\'),',now())");

     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('FedEx Key', 'MODULE_SHIPPING_FEDEX_KEY', '0', 'Enter FedEx Key', '6', '0', now())");

     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('FedEx Password', 'MODULE_SHIPPING_FEDEX_PWD', '0', 'Enter FedEx Password', '6', '0', now())");	  

     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('FedEx Account Number', 'MODULE_SHIPPING_FEDEX_ACT_NUM', '0', 'Enter FedEx Account Number', '6', '0', now())");

  	tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('FedEx Meter Number', 'MODULE_SHIPPING_FEDEX_METER_NUM', '0', 'Enter FedEx Meter Number', '6', '0', now())");  

     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FEDEX_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");	  

}

function remove()
{
tep_db_query("DELETE FROM ". TABLE_CONFIGURATION ." WHERE configuration_key in ('". implode("','",$this->keys()). "')");
}

function keys()
{
return array('MODULE_SHIPPING_FEDEX_STATUS','MODULE_SHIPPING_FEDEX_KEY','MODULE_SHIPPING_FEDEX_PWD','MODULE_SHIPPING_FEDEX_ACT_NUM','MODULE_SHIPPING_FEDEX_METER_NUM',
'MODULE_SHIPPING_FEDEX_SORT_ORDER');
}

}
?>

 

In the checkout_shipping step, the 3 method are in the $quotes value but when I click on "continue" I come back on the same page not in the next : checkout_paiment

 

Any ideas are welcome

Thanks

Link to comment
Share on other sites

are using the contribution at http://www.oscommerce.com/community/contributions,6788? if you are, you need to add few extra lines and do some changes to make it work.

i had a similar problem... basically the issue i had was caused by the values generated to the radio input options, they need to have different values for the form to go to the next page when submitted

Link to comment
Share on other sites

BEFORE YOU MAKE ANY CHANGES, BACK UP!!!

 

in your fedex module file, in catalog/includes/modules/shipping

 

if you're using the contribution mentioned in my previous post, the file should be named fedex_module.php

 

still assuming you're using that contribution, you need to add

$code = $rateReply -> ServiceType;

 

That will set the value of the servicetype to code, which should give an unique value for each different service type. THEN, in your file /catalog/checkout_shipping.php, on line 110, change:

 

list($module, $method) = explode('_', $shipping);

 

to

 

list($module, $method) = explode('-', $shipping);

 

(only thing to change is the underscore "_" to the dash "-")

 

and on line 331, change:

<td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' .$quotes[$i]['methods'][$j]['id'], $checked); ?></td>

 

to

 

<td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '-' .$quotes[$i]['methods'][$j]['id'], $checked); ?></td>

 

again, you have to change the underscore to dash.

 

Basically, what you just did is change the delimiter that seperates the module name from the code, from _ to -. You have to do this because the servicetypes generated by Fedex has underscores; so the script will be confused.

Link to comment
Share on other sites

try changing the underscore to a dash on the line you found; and see if it works?

 

can you also copy and paste the HTML code of your checkout_shipping.php, not the source file, the code that you get when you right click on the site and go to View source

Edited by uckc
Link to comment
Share on other sites

I will check tomorrow morning (22H15 here French Time)

I will reply to you later

below the HTML code

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>spareparts.pro</title>
<base href="http://wilanneconcept.com/catalog/">
<link rel="stylesheet" type="text/css" href="stylesheet.css.php">

<div id="please_wait" style="padding:35px; position:absolute; top: 50%; left:30%; border:solid 2px #0066cc; background-color:#3399ff; visibility:hidden; color:#ffffff; font-weight:bold; font-size:18px">
Please wait while shipping charges are adjusted...

</div>

<script language="javascript"><!--
function show_please_wait() {
document.getElementById('please_wait').style.visibility="visible";
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
 if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
MM_preloadImages('/catalog/images/header-button-on.gif','/catalog/images/button-pressed.gif');
//-->
</script>

<table border="0" width="100%" height="80" cellspacing="0" cellpadding="0">
 <tr class="headerNavigation">
   <td nowrap class="headerNavigation">  <a href="http://wilanneconcept.com/catalog/default.php" class="headerNavigation">Top</a> » <a href="http://wilanneconcept.com/catalog/checkout_shipping.php?osCsid=32908d48e46f59bdbba0d8851259ef4f" class="headerNavigation">Checkout</a> » <a href="http://wilanneconcept.com/catalog/checkout_shipping.php?osCsid=32908d48e46f59bdbba0d8851259ef4f" class="headerNavigation">Shipping Method</a>		<br><br>

	 
	<a href=http://wilanneconcept.com/catalog/default.php>
	<img src="/catalog/images/SPP-logo-colors.gif" border="0" alt="spareparts.pro" title=" spareparts.pro " width="53" height="53">		<img src="/catalog/images/SPP.gif" border="0" alt="spareparts.pro" title=" spareparts.pro " width="196" height="50">		</a>
</td>
<td nowrap align="right" class="headerNavigation">
<br><br>
<table border="0" cellpadding="0" cellspacing="0">
	<tr>

		<td></td>
		<td align="center"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-quote','','/catalog/images/button-pressed.gif',1)" href="http://wilanneconcept.com/catalog/quote_shipping_address.php"><img src="/catalog/images/button.gif" border="0" alt="Our Customers" title=" Our Customers " width="40" height="43" name="header-button-quote"></a></td>


					<td><img src="/catalog/images/button-separator.gif" border="0" alt="" width="11" height="41"></td>
		<td width="68" align="center"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-support','','/catalog/images/button-pressed.gif',1)" href="http://wilanneconcept.com/catalog/complaint.php"><img src="/catalog/images/button.gif" border="0" alt="Complaint" title=" Complaint " width="40" height="43" name="header-button-support"></a></td>			<td></td>
		</tr>
	<tr>
		<td></td>
		<td align="center" class="main" nowrap><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-quote','','/catalog/images/button-pressed.gif',1)" href="http://wilanneconcept.com/catalog/quote_shipping_address.php">Instant Quote</a></td>




		<td></td>


				<td align="center" class="main"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-support','','/catalog/images/button-pressed.gif',1)" href="http://wilanneconcept.com/catalog/complaint.php">Complaint</a></td> 			




		<td></td>
	</tr>
</table>
</td>
<td nowrap width="74" class="headerNavigationTrans">  </td>
   <td width="350" align="right" class="headerNavigationRight">
	<br>

	<table height=50 border="0" cellpadding=0 cellspacing=0>
	<tr>
		<td nowrap width=80 class="headerNavigationText">
							<a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-logoff','','/catalog/images/button-gray-pressed.gif',1)" href="http://wilanneconcept.com/catalog/logoff.php?osCsid=32908d48e46f59bdbba0d8851259ef4f" class="headerNavigation">Log Off</a></td>
		<td nowrap width=80 class="headerNavigationText">   					<a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-myaccount','','/catalog/images/button-gray-pressed.gif',1)" href="http://wilanneconcept.com/catalog/account.php?osCsid=32908d48e46f59bdbba0d8851259ef4f" class="headerNavigation">My Account</a></td>
		<td nowrap width=80 class="headerNavigationText">   <a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-cart','','/catalog/images/button-gray-pressed.gif',1)" href="http://wilanneconcept.com/catalog/shopping_cart.php" class="headerNavigation">My Cart</a></td>

		<td nowrap width=80 class="headerNavigationText">   <a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-checkout','','/catalog/images/button-gray-pressed.gif',1)" href="http://wilanneconcept.com/catalog/checkout_shipping_address.php?osCsid=32908d48e46f59bdbba0d8851259ef4f" class="headerNavigation">Checkout</a></td>
	</tr>	
	<tr>
    	<td align="center"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-logoff','','/catalog/images/button-gray-pressed.gif',1)" href="http://wilanneconcept.com/catalog/logoff.php"><img src="/catalog/images/button-gray.gif" border="0" alt="Logoff" title=" Logoff " width="40" height="40" name="header-button-logoff"></a></td>
    	<td align="center"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-myaccount','','/catalog/images/button-gray-pressed.gif',1)" href="http://wilanneconcept.com/catalog/account.php?osCsid=32908d48e46f59bdbba0d8851259ef4f"><img src="/catalog/images/button-gray.gif" border="0" alt="My Account" title=" My Account " width="40" height="40" name="header-button-myaccount"></a></td>
    	<td align="center"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-cart','','/catalog/images/button-gray-pressed.gif',1)" href="http://wilanneconcept.com/catalog/shopping_cart.php"><img src="/catalog/images/button-gray.gif" border="0" alt="Shopping Cart Contents" title=" Shopping Cart Contents " width="40" height="40" name="header-button-cart"></a></td>
    	<td align="center"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('header-button-checkout','','/catalog/images/button-gray-pressed.gif',1)" href="http://wilanneconcept.com/catalog/checkout_shipping_address.php?osCsid=32908d48e46f59bdbba0d8851259ef4f"><img src="/catalog/images/button-gray.gif" border="0" alt="Checkout" title=" Checkout " width="40" height="40" name="header-button-checkout"></a></td>
   </tr>

	</table>
</td>
 </tr>
</table>


<!-- header_eof //-->
<pre>Array
(
   [id] => FedexModule_INTERNATIONAL-ECONOMY
   [title] => FedEx (International economy)
   [cost] => 229.11
)
</pre><!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="140" valign="top"><table border="0" width="140" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->
<!-- information //-->
         <tr>
           <td>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="1"><table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td height="14" class="infoBoxHeading"><img src="/catalog/images/infobox/corner_right_left.gif" border="0" alt="" width="11" height="14"></td>
   <td width="100%" height="14" class="infoBoxHeading">Information</td>
   <td height="14" class="infoBoxHeading" nowrap><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>

</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
   <td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
   <td><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
   <td class="boxText"><a href="http://wilanneconcept.com/catalog/shipping.php">Shipping & Returns</a><br><a href="http://wilanneconcept.com/catalog/privacy.php">Privacy Notice</a><br><a href="http://wilanneconcept.com/catalog/conditions.php">Conditions of Use</a><br><a href="http://wilanneconcept.com/catalog/company.php">Company</a><br><a href="http://wilanneconcept.com/catalog/contact_us.php">Contact Us</a></td>

 </tr>
 <tr>
   <td><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>

</td>
 </tr>
</table>
</td><td class="infoBoxShadowRight"><img src="/catalog/images/infobox/shadow-corner-upper-right.gif" border="0" alt="" width="8" height="15"></td></tr>
  													 <tr>

													 <td class="infoBoxShadowBottom"><img src="/catalog/images/infobox/shadow-corner-bottom-left.gif" border="0" alt="" width="9" height="8"></td>
													 <td width="8"><img src="/catalog/images/infobox/shadow-corner-bottom-right.gif" border="0" alt="" width="7" height="9"></td>
													 </tr>
													 </table>            </td>
         </tr>
<!-- information_eof //-->
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><form name="checkout_address" action="http://wilanneconcept.com/catalog/checkout_shipping.php?osCsid=32908d48e46f59bdbba0d8851259ef4f" method="post"><input type="hidden" name="action" value="process"><table border="0" width="100%" cellspacing="0" cellpadding="0">

     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading">Shipping Information</td>
           <td class="pageHeading" align="right"></td>
         </tr>
       </table></td>
     </tr>

     <tr>
       <td><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
     </tr>
     <tr>
      <td class="main"><b>Shipping Address</b></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2"  class="infoBox">

         <tr class="infoBoxContents">
				<td>
             <table border="0" cellspacing="0" cellpadding="0"><tr>
						<td><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
					  <td class="main">spareparts.pro<br>Stephan<br>137allée des acacias<br>che<br>entraigues, ste    84320<br>France<br></td>
						</tr></table>

         </td>
				</tr>
       </table></td>
     </tr>
     <tr>
       <td><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

				<tr>
           <td class="main">
	<table class="TitledContentBox" width="100%" cellspacing="0" cellpadding = "2">
		<tr class="TitledContentBoxHeading">
			<td class="TitledContentBoxHeading">Shipping Methods</td>
						</tr>
		<tr class="TitledContentBoxContent">
			<td colspan="2" class="TitledContentBoxContent">		<script language="javascript">
		if(document.all && !document.getElementById) {
				document.getElementById = function(id) {
						 return document.all[id];
				}
		}

		function rowOver(object) {
			if (object.className == 'dataTableRow')
				object.className = 'dataTableRowOver';
		}

		function rowOut(object) {
			if (object.className == 'dataTableRowOver')
				object.className = 'dataTableRow';
		}


			var ship_selected;

			function selectRow(index) {				
				if (ship_selected) ship_selected.className = 'dataTableRow';
				object = document.getElementById('ship_row_' + index);
				if (object) {
					object.className = 'dataTableRowSelected';
					ship_selected = object;
				}
				button = document.getElementById('ship_select_' + index);
				if (button)
					button.checked = true;
			}

				</script>

	<div id="ship">
			<table width="100%" border="0" cellspacing="0" cellpadding="4">
	<tr class="dataTableHeadingRow">

    	<td class="dataTableHeadingContent" nowrap>
			Shipping Method				</td>

    	<td class="dataTableHeadingContent" nowrap>
			Cost				</td>
		 <td class="dataTableHeadingContent">Select</td> 		</tr>

						<tr class="formEntrySectionHeading">
				<td colspan="11" class="formEntrySectionHeading"><div align="left">FedEx</div></td>			

			<tr id="ship_row_1" class="dataTableRow" 

					onMouseOver="rowOver(this);
					this.style.cursor='pointer';" 
					onMouseOut="rowOut(this);" 
											onClick="selectRow(1)">
				    		<td class="dataTableContent">
				International first					</td>
				    		<td class="dataTableContent">
				EU316.56					</td>
							<td class="dataTableContent"><input type="radio" name="ship_select_id" id="ship_select_1" value="FedexModule_INTERNATIONAL-FIRST"></td>

						</tr>

			<tr id="ship_row_2" class="dataTableRow" 

					onMouseOver="rowOver(this);
					this.style.cursor='pointer';" 
					onMouseOut="rowOut(this);" 
											onClick="selectRow(2)">
				    		<td class="dataTableContent">
				International priority					</td>
				    		<td class="dataTableContent">
				EU254.43					</td>
							<td class="dataTableContent"><input type="radio" name="ship_select_id" id="ship_select_2" value="FedexModule_INTERNATIONAL-PRIORITY"></td>
						</tr>


			<tr id="ship_row_3" class="dataTableRow" 

					onMouseOver="rowOver(this);
					this.style.cursor='pointer';" 
					onMouseOut="rowOut(this);" 
											onClick="selectRow(3)">
				    		<td class="dataTableContent">
				International economy					</td>
				    		<td class="dataTableContent">
				EU229.11					</td>
							<td class="dataTableContent"><input type="radio" name="ship_select_id" id="ship_select_3" value="FedexModule_INTERNATIONAL-ECONOMY"></td>
						</tr>
						<tr class="formEntrySectionHeading">

				<td colspan="11" class="formEntrySectionHeading"><div align="left">Shipping</div></td>			

			<tr id="ship_row_4" class="dataTableRow" 

					onMouseOver="rowOver(this);
					this.style.cursor='pointer';" 
					onMouseOut="rowOut(this);" 
											onClick="selectRow(4)">
				    		<td class="dataTableContent">
				Shipping Cost					</td>
				    		<td class="dataTableContent">
				EU1,001.00					</td>
							<td class="dataTableContent"><input type="radio" name="ship_select_id" id="ship_select_4" value="indvship_indvship"></td>
						</tr>

						<tr class="formEntrySectionHeading">
				<td colspan="11" class="formEntrySectionHeading"><div align="left">Per Item</div></td>			

			<tr id="ship_row_5" class="dataTableRow" 

					onMouseOver="rowOver(this);
					this.style.cursor='pointer';" 
					onMouseOut="rowOut(this);" 
											onClick="selectRow(5)">
				    		<td class="dataTableContent">
				Best Way					</td>
				    		<td class="dataTableContent">
				EU1,000.00					</td>
							<td class="dataTableContent"><input type="radio" name="ship_select_id" id="ship_select_5" value="item_item"></td>

						</tr>

	</table>
			<script language="JavaScript">
		selectRow(3);
	</script>
			</div>
	</td>
		</tr>
	</table> 


	</td>
     </tr>

     <tr>
       <td><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
     </tr>
		<tr>
       <td class="main"><b>Note:</b> All our products are freight cost including</td>
     </tr>
     <tr>

       <td><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
               <td class="main"><b>Continue Checkout Procedure</b><br>to select the preferred payment method.</td>

               <td class="main" align="right"><input type="image" src="/catalog/includes/languages/english/images/buttons/button_continue.gif" border="0" alt="Continue" title=" Continue "></td>
               <td width="10"><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><img src="/catalog/images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>

     </tr>
   </table></form>
	<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td style="text-align:center;background-repeat:repeat-x;background-position:5;background-image:url(/catalog/images/pixel_silver.gif);"></td><td style="text-align:center;background-repeat:repeat-x;background-position:5;background-image:url(/catalog/images/pixel_silver.gif);"><img src="/catalog/images/checkout_bullet.gif" border="0" alt="" width="11" height="11"></td><td style="text-align:center;background-repeat:repeat-x;background-position:5;background-image:url(/catalog/images/pixel_silver.gif);"></td><td style="text-align:center;background-repeat:repeat-x;background-position:5;background-image:url(/catalog/images/pixel_silver.gif);"></td><td style="text-align:center;background-repeat:repeat-x;background-position:5;background-image:url(/catalog/images/pixel_silver.gif);"></td></tr><tr><td align="center" class="checkoutBarFrom"><a href="checkout_shipping_address.php">Shipping Address</a></td><td align="center" class="checkoutBarCurrent">Shipping Method</td><td align="center" class="checkoutBarTo">Payment Information</td><td align="center" class="checkoutBarTo">Confirmation</td><td align="center" class="checkoutBarTo">Finished!</td></tr></table>		
	</td>
<!-- body_text_eof //-->
   <td width="140" valign="top"><table border="0" width="140" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<!-- right_navigation_eof //-->

   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<table border="0" width="100%" height="94" cellspacing="0" cellpadding="0">
 <tr class="footer">
   <td width="240" class="footer-left"><img src="/catalog/images/footer-spool-left.gif" border="0" alt="" width="243" height="94"></td>
   <td class="footer-trans">  </td>
   <td width="675"class="footer-right">  </td>

 </tr>
</table>

<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr>
   <td class="footer-left">  Monday 29 June, 2009  </td>
   <td align="right" class="footer-left">  
			  </td>
 </tr>
</table>

<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="center" class="smallText">
Copyright © 2009 <a href="http://www.spareparts.pro" target="_blank">spareparts.pro</a>    </td>
 </tr>
</table>
<div align=right><a class="hidden" target="_blank" href="http://wilanneconcept.com/admin/">π</a></div>

<!-- footer_eof //-->
<br>
</body>
</html>

Link to comment
Share on other sites

I just saw your html code, and the radio inputs values are correct. I noticed your servicetypes use a dash instead of the underscore. Because of that, you will need to change the dash you had changed earlier, back to the underscore.

ALSO, do not change the other underscore to dash like I asked you to do...

 

Now that the servicetypes are assigned to the radio inputs values, the form should proceed to the next page.

Link to comment
Share on other sites

Yes the input radio are correct, I tried many way but it doesn't work ...

Yes I changed the services type directly in the fedex module PHP

foreach ($response -> RateReplyDetails as $rateReply)
		{           

		   $title="";
		   /* FedEx integration ends */

			  global $order;

$rateReply -> ServiceType = str_replace("_", "-", $rateReply -> ServiceType);

and

if($rateReply -> ServiceType=='FIRST-OVERNIGHT'){
			  				    $title= "First OverNight";

Link to comment
Share on other sites

then i must have had a different problem than yours. in fact, looking at your code, your checkout_shipping.php is very different from mine; and I`m no pro either, so I don`t think I can think help you any further

Link to comment
Share on other sites

checkout_shipping.php

<?php
/*
 $Id: checkout_shipping.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
 require('includes/classes/http_client.php');

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
 }

// if no shipping destination address was selected, use the customers own address as default
 if (!tep_session_is_registered('sendto')) {
tep_session_register('sendto');
$sendto = $customer_default_address_id;
 } else {
// verify the selected shipping address
if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) {
  $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
  $check_address = tep_db_fetch_array($check_address_query);

  if ($check_address['total'] != '1') {
	$sendto = $customer_default_address_id;
	if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
  }
}
 }

 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
 if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
 $cartID = $cart->cartID;

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
 if ($order->content_type == 'virtual') {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
$shipping = false;
$sendto = false;
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }

 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();

// load all enabled shipping modules
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping;

 if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
$pass = false;

switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
  case 'national':
	if ($order->delivery['country_id'] == STORE_COUNTRY) {
	  $pass = true;
	}
	break;
  case 'international':
	if ($order->delivery['country_id'] != STORE_COUNTRY) {
	  $pass = true;
	}
	break;
  case 'both':
	$pass = true;
	break;
}

$free_shipping = false;
if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
  $free_shipping = true;

  include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
}
 } else {
$free_shipping = false;
 }

// process the selected shipping method
 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
if (!tep_session_is_registered('comments')) tep_session_register('comments');
if (tep_not_null($HTTP_POST_VARS['comments'])) {
  $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
}

if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
  if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '-')) ) {
	$shipping = $HTTP_POST_VARS['shipping'];

	list($module, $method) = explode('-', $shipping);
	if ( is_object($$module) || ($shipping == 'free_free') ) {
	  if ($shipping == 'free_free') {
		$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
		$quote[0]['methods'][0]['cost'] = '0';
	  } else {
		$quote = $shipping_modules->quote($method, $module);
	  }
	  if (isset($quote['error'])) {
		tep_session_unregister('shipping');

	  } else {
		if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
		  $shipping = array('id' => $shipping,
							'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
							'cost' => $quote[0]['methods'][0]['cost']);

		  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
		}
	  }
	} else {
	  tep_session_unregister('shipping');
	}
  }
} else {
  $shipping = false;

  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}	
 }

// get all available shipping quotes
 $quotes = $shipping_modules->quote();

// if no shipping method has been selected, automatically select the cheapest method.
// if the modules status was changed when none were available, to save on implementing
// a javascript force-selection method, also automatically select the cheapest shipping
// method if more than one module is now enabled
 if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);

 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
?>
<!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>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
var selected;

function selectRowEffect(object, buttonSelect) {
 if (!selected) {
if (document.getElementById) {
  selected = document.getElementById('defaultSelected');
} else {
  selected = document.all['defaultSelected'];
}
 }

 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;

// one button is not an array
 if (document.checkout_address.shipping[0]) {
document.checkout_address.shipping[buttonSelect].checked=true;
 } else {
document.checkout_address.shipping.checked=true;
 }
}

function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php //echo tep_image(DIR_WS_IMAGES . 'table_background_delivery.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="0" cellpadding="2">
			  <tr>

				<td class="main" valign="top"><?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?></td>
				<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
			  </tr>
			</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 if (tep_count_shipping_modules() > 0) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {
?>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></td>
			<td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b>'; ?></td>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
<?php
} elseif ($free_shipping == false) {
?>

<?php
}

if ($free_shipping == true) {
?>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td colspan="2" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b> <?php echo $quotes[$i]['icon']; ?></td>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
			  <tr id="defaultSelected" class="moduleRowSelected" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="selectRowEffect(this, 0)">
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
			</table></td>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
		  </tr>
<?php
} else {
  $radio_buttons = 0;
  for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
?>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" colspan="3"><b><?php echo $quotes[$i]['module']; ?></b> <?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
	if (isset($quotes[$i]['error'])) {
?>
			  <tr>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" colspan="3"><?php echo $quotes[$i]['error']; ?></td>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
	} else {
	  for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
		$checked = (($quotes[$i]['id'] . '-' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);

		if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
		  echo '				  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
		} else {
		  echo '				  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
		}
?>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" width="75%"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>
<?php
		if ( ($n > 1) || ($n2 > 1) ) {
?>
				<td class="main"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
				<td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '-' .$quotes[$i]['methods'][$j]['id'], $checked); ?></td>
<?php
		} else {
?>
				<td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '-' . $quotes[$i]['methods'][$j]['id']); ?></td>
<?php
		}
?>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
		$radio_buttons++;
	  }
	}
?>
			</table></td>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
		  </tr>
<?php
  }
}
?>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
			<td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="50%" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
			<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
		  </tr>
		</table></td>
		<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
		<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
		<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
			<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
		<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
		<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
		<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
	  </tr>
	</table></td>
  </tr>
</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

fedex_module.php

<?php

class fedex_module{
var $code, $title, $description, $icon, $enabled;

//Class Constructor
function fedex_module()
{
	global $order;
	 global $customer_id;

	$this->code 			= "fedex_module";
	$this->title 			= MODULE_SHIPPING_FEDEX_TEXT_TITLE;
	$this->description		= MODULE_SHIPPING_FEDEX_TEXT_DESCRIPTION;
	$this->sort_order		= MODULE_SHIPPING_FEDEX_SORT_ORDER;
	 $this->icon = DIR_WS_ICONS . 'shipping_fedex.gif';
	//$this->icon				= '';
	$this->enabled			= ((MODULE_SHIPPING_FEDEX_STATUS == 'True') ? true : false);
	$this->fedex_key		= MODULE_SHIPPING_FEDEX_KEY;
	$this->fedex_pwd		= MODULE_SHIPPING_FEDEX_PWD;
	$this->fedex_act_num	= MODULE_SHIPPING_FEDEX_ACT_NUM;
	$this->fedex_meter_num	= MODULE_SHIPPING_FEDEX_METER_NUM;

}

//Class Methods

function quote($method = '')
{
/* FedEx integration starts */
 global $customer_id;

require_once(DIR_WS_INCLUDES.'library/fedex-common.php5');

$path_to_wsdl = DIR_WS_INCLUDES."wsdl/RateService_v6.wsdl";

$client = new SoapClient($path_to_wsdl, array('trace' => 1));

//Fetching user details
//Key
$key = tep_db_query("SELECT configuration_value FROM ". TABLE_CONFIGURATION ." WHERE configuration_key = 'MODULE_SHIPPING_FEDEX_KEY'");
$key_value = tep_db_fetch_array($key);

$fedex_key = $key_value['configuration_value'];
//Password
$pwd = tep_db_query("SELECT configuration_value FROM ".TABLE_CONFIGURATION ." WHERE configuration_key = 'MODULE_SHIPPING_FEDEX_PWD'");
$pwd_value = tep_db_fetch_array($pwd);

$fedex_password = $pwd_value['configuration_value'];
//Account Number
$act_num = tep_db_query("SELECT configuration_value FROM ".TABLE_CONFIGURATION ." WHERE configuration_key = 'MODULE_SHIPPING_FEDEX_ACT_NUM'");
$act_num_value = tep_db_fetch_array($act_num);
$fedex_act_num = $act_num_value['configuration_value'];	
//Meter Number
$meter_num = tep_db_query("SELECT configuration_value FROM ".TABLE_CONFIGURATION ." WHERE configuration_key = 'MODULE_SHIPPING_FEDEX_METER_NUM'");
$meter_num_value = tep_db_fetch_array($meter_num);
$fedex_meter_num = $meter_num_value['configuration_value'];		

if ($customer_id) {

//customer  Details
$customers_query = tep_db_query("select customers_default_address_id from customers WHERE customers_id='" . (int)$customer_id . "'");
$customers = tep_db_fetch_array($customers_query);
$customers_default_address_id=$customers['customers_default_address_id'];

 $address_query = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customers_default_address_id . "'");
	$address = tep_db_fetch_array($address_query);

 $street_address=$address['street_address'];
 $city=$address['city'];
 $state=$address['state'];
 $postcode=$address['postcode'];
 $country_id=$address['country_id'];
 $zone_id=$address['zone_id'];
 if($state==""){

	$address_format_query1 = tep_db_query("select zone_code from zones where zone_country_id = '" . (int)$country_id . "' AND zone_id='" . (int)$zone_id . "' ");
	$address_format1 = tep_db_fetch_array($address_format_query1);
	$state=$address_format1['zone_code'];
 }

 //echo "select countries_iso_code_2 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'";
 $address_format_query = tep_db_query("select countries_iso_code_2 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
	if (tep_db_num_rows($address_format_query)) {
	  $address_format = tep_db_fetch_array($address_format_query);
	  $CountryCode= $address_format['countries_iso_code_2'];

	 }
}

$request['WebAuthenticationDetail'] = array('UserCredential' =>
								  array('Key' => $fedex_key, 'Password' => $fedex_password)); 									  
$request['ClientDetail'] = array('AccountNumber' => $fedex_act_num, 'MeterNumber' => $fedex_meter_num);									  
$request['TransactionDetail'] = array('CustomerTransactionId' => ' *** Rate Request v6 using PHP ***');
$request['Version'] = array('ServiceId' => 'crs', 'Major' => '6', 'Intermediate' => '0', 'Minor' => '0');
//$request['ReturnTransitAndCommit'] = true;
$request['RequestedShipment']['DropoffType'] = 'REGULAR_PICKUP'; // valid values REGULAR_PICKUP, REQUEST_COURIER, ...
$request['RequestedShipment']['ShipTimestamp'] = date('c');
//$request['RequestedShipment']['ServiceType'] = 'PRIORITY_OVERNIGHT'; // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ...
$request['RequestedShipment']['PackagingType'] = 'YOUR_PACKAGING'; // valid values FEDEX_BOX, FEDEX_PAK, FEDEX_TUBE, YOUR_PACKAGING, ...	
$request['RequestedShipment']['Shipper'] = array('Address' => array(
									   'StreetLines' => array('XXXXXXXXXXXXXXXXXXXXXXXX'), // Origin details
									  'City' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
									  'StateOrProvinceCode' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
									  'PostalCode' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
									  'CountryCode' => 'US'));


$request['RequestedShipment']['Recipient'] = array('Address' => array (
										   'StreetLines' => array($street_address), // customer street address
										   'City' => $city, //customer city
										   'StateOrProvinceCode' => $state, //customer state
										   'PostalCode' => $postcode, //customer postcode
										   'CountryCode' => $CountryCode)); //customer county code
//print_r($request['RequestedShipment']['Recipient']);
//exit;									   
$request['RequestedShipment']['ShippingChargesPayment'] = array('PaymentType' => 'SENDER',
													'Payor' => array('AccountNumber' => $fedex_act_num, // Replace 'XXX' with payor's account number
																 'CountryCode' => 'US'));
$request['RequestedShipment']['RateRequestTypes'] = 'ACCOUNT'; 
$request['RequestedShipment']['RateRequestTypes'] = 'LIST'; 
$request['RequestedShipment']['PackageCount'] = '1';
$request['RequestedShipment']['PackageDetail'] = 'INDIVIDUAL_PACKAGES';	
$request['RequestedShipment']['RequestedPackages'] = array('0' => array('SequenceNumber' => '1',
															  'InsuredValue' => array('Amount' => 0.0,
																					  'Currency' => 'USD'),
															  'ItemDescription' => 'College Transcripts',
															  'Weight' => array('Value' => 0.5,
																				'Units' => 'LB'),
															  'Dimensions' => array('Length' => 1,
																					'Width' => 1,
																					'Height' => 1,
																					'Units' => 'IN'),
															  'CustomerReferences' => array('CustomerReferenceType' => 'CUSTOMER_REFERENCE',
																							 'Value' => 'Undergraduate application')));

try 
{
	$response = $client ->getRates($request);

	if ($response -> HighestSeverity != 'FAILURE' && $response -> HighestSeverity != 'ERROR')
	{
		//echo 'Rates for following service type(s) were returned.'. $newline. $newline; 
		$title="Unknown Shipping Method";
		foreach ($response -> RateReplyDetails as $rateReply)
		{		   
		  // echo $rateReply -> ServiceType, $newline;
		 //  echo "Total Net Charge = ";
		  // echo($rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount), $newline, $newline;

		   /* FedEx integration ends */
			  global $order;
			  if($rateReply -> ServiceType=='FIRST_OVERNIGHT'){
				$title= "First OverNight";
			  }else if($rateReply -> ServiceType=='PRIORITY_OVERNIGHT'){
				$title= "Priority OverNight";
			  }else if($rateReply -> ServiceType=='STANDARD_OVERNIGHT'){
				$title= "Standard OverNight";
			  }else if($rateReply -> ServiceType=='FEDEX_2_DAY'){
				$title= "2nd Day";
			  }else if($rateReply -> ServiceType=='FEDEX_EXPRESS_SAVER'){
				$title= "Express Saver";
			  }else if($rateReply -> ServiceType=='FEDEX_GROUND'){
				$title= "Ground Shipping";
			  }
			  else if($rateReply -> ServiceType=='EUROPE_FIRST_INTERNATIONAL_PRIORITY'){
				  $title = "Europe First International Priority";
			  }
			  else if($rateReply -> ServiceType=='FEDEX_1_DAY_FREIGHT'){
				  $title = "Fedex One Day Freight";
			  }
			  else if($rateReply -> ServiceType=='FEDEX_2_DAY_FREIGHT'){
				  $title = "Fedex Two Day Freight";
			  }
			  else if($rateReply -> ServiceType=='FEDEX_3_DAY_FREIGHT'){
				  $title = "Fedex Three Day Freight";
			  }
			  else if($rateReply -> ServiceType=='GROUND_HOME_DELIVERY'){
				  $title = "Ground Home Delivery";
			  }
			  else if($rateReply -> ServiceType=='INTERNATIONAL_DISTRIBUTION_FREIGHT'){
				  $title = "International Distribution Freight";
			  }
			  else if($rateReply -> ServiceType=='INTERNATIONAL_ECONOMY'){
				  $title = "Internation Economy";
			  }
			  else if($rateReply -> ServiceType=='INTERNATIONAL_ECONOMY_DISTRIBUTION'){
				  $title = "Internation Economy Distribution";
			  }
			  else if($rateReply -> ServiceType=='INTERNATIONAL_ECONOMY_FREIGHT'){
				  $title = "Internation Economy Freight";
			  }
			  else if($rateReply -> ServiceType=='INTERNATIONAL_FIRST'){
				  $title = "International First";
			  }
			  else if($rateReply -> ServiceType=='INTERNATIONAL_PRIORITY'){
				  $title = "International Priority";
			  }
			  else if($rateReply -> ServiceType=='INTERNATIONAL_PRIORITY_DISTRIBUTION'){
				  $title = "International Priority Distribution";
			  }
			  else if($rateReply -> ServiceType=='INTERNATIONAL_PRIORITY_FREIGHT'){
				  $title = "International Priority Freight";
			  }
			  else if($rateReply -> ServiceType=='SMART_POST'){
				  $title = "Smart Post";
			  }
			  else if($rateReply -> ServiceType=='FEDEX_FREIGHT'){
				  $title = "Fedex Freight";
			  }
			  else if($rateReply -> ServiceType=='FEDEX_NATIONAL_FREIGHT'){
				  $title = "Fedex National Freight";
			  }

			  $code = $rateReply -> ServiceType;

			  $methods[]=array('id' => $code,
							  'title' =>$title,
							  'cost' => $rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount);



		}
		$this->quotes=array('id' => $this->code,
									'module' => MODULE_SHIPPING_FEDEX_TEXT_TITLE,
									'methods' =>$methods); 
		return $this->quotes;
		//printRequestResponse($client);
	}
	else
	{
		echo 'Error in processing transaction.'. $newline. $newline; 
		foreach ($response -> Notifications as $notification)
		{		   
			if(is_array($response -> Notifications))
			{			  
			   echo $notification -> Severity;
			   echo ': ';		   
			   echo $notification -> Message . $newline;
			}
			else
			{
				echo $notification . $newline;
			}
		} 
	} 


	writeToLog($client);	// Write to log file   

} catch (SoapFault $exception) {
   printFault($exception, $client);		
}									/**/															 


}

function check()
{
if(!isset($this->_check))
{
	$check_query  = tep_db_query("SELECT configuration_value FROM ". TABLE_CONFIGURATION ." WHERE configuration_key = 'MODULE_SHIPPING_FEDEX_STATUS'");
	$this->_check = tep_db_num_rows($check_query);
}
return $this->_check;
}

function install()
{
tep_db_query("INSERT INTO ". TABLE_CONFIGURATION ." (configuration_title,configuration_key,configuration_value,configuration_desc
ription,configuration_group_id,
sort_order,set_function,date_added) VALUES ('Enable FedEx Shipping','MODULE_SHIPPING_FEDEX_STATUS','True','Dou you want to offer FedEx shipping?','6','0',
'tep_cfg_select_option(array(\'True\',\'False\'),',now())");

  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('FedEx Key', 'MODULE_SHIPPING_FEDEX_KEY', '0', 'Enter FedEx Key', '6', '0', now())");

  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('FedEx Password', 'MODULE_SHIPPING_FEDEX_PWD', '0', 'Enter FedEx Password', '6', '0', now())");	  

  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('FedEx Account Number', 'MODULE_SHIPPING_FEDEX_ACT_NUM', '0', 'Enter FedEx Account Number', '6', '0', now())");

	  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('FedEx Meter Number', 'MODULE_SHIPPING_FEDEX_METER_NUM', '0', 'Enter FedEx Meter Number', '6', '0', now())");  

  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, 
  sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FEDEX_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");	  

}

function remove()
{
tep_db_query("DELETE FROM ". TABLE_CONFIGURATION ." WHERE configuration_key in ('". implode("','",$this->keys()). "')");
}

function keys()
{
return array('MODULE_SHIPPING_FEDEX_STATUS','MODULE_SHIPPING_FEDEX_KEY','MODULE_SHIPPING_FEDEX_PWD','MODULE_SHIPPING_FEDEX_ACT_NUM','MODULE_SHIPPING_FEDEX_METER_NUM',
'MODULE_SHIPPING_FEDEX_SORT_ORDER');
}

}
?>

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 3 weeks later...

Anybody have this working yet? I've got it set up and have my credentials (for the person who asked where to get this stuff, go to fedex.com/developer - then on the 6 check boxes - you will click the top middle one and get set up with test validations, after that you can get production ones).

 

Anyways, my error message is:

Error in processing transaction.ERRORprof1000Authentication Failed

 

I'm going to try production info - if it is not working, I'll just move it to false and wait for a response on here. Hoping to simply hear that somebody has this contribution working....

 

Thanks!

Justin

Link to comment
Share on other sites

Tried production values, and still the same "ERRORprof1000Authentication Failed" .

 

How is everybody else generating shipping prices without this fedex module? Is there another one I'm not aware of? Maybe it is my fedex password though, I'm just using my password from fedex.com - perhaps there is another one?

 

Thanks for any input!

Justin

Link to comment
Share on other sites

OK, so I got it working - it is a password they email to you, not your fedex.com password. Now my problem is it generates the same rates independent of weight, or of zip code. The problem lies in the includes/modules/shipping/fedex_module

 

This file is not at all finished. If you look on line 124, you will realize that it won't generate the weights etc. from the shopping cart, it is set up with a static insured value of $20, weight of 2 pounds etc.

 

Somebody needs to finish this module, and it is over my head. I'm going to try, and if unable - I will hire somebody and give this back to the community working. Can't believe it was put up this flawed though, very incomplete - and somebody should note that when releasing a contribution...

Link to comment
Share on other sites

  • 3 months later...

OK, so I got it working - it is a password they email to you, not your fedex.com password. Now my problem is it generates the same rates independent of weight, or of zip code. The problem lies in the includes/modules/shipping/fedex_module

 

This file is not at all finished. If you look on line 124, you will realize that it won't generate the weights etc. from the shopping cart, it is set up with a static insured value of $20, weight of 2 pounds etc.

 

Somebody needs to finish this module, and it is over my head. I'm going to try, and if unable - I will hire somebody and give this back to the community working. Can't believe it was put up this flawed though, very incomplete - and somebody should note that when releasing a contribution...

 

I am just finishing up fixing this module and will add it when completed.

It needed a lot of things changed... (so many I doubt it works for v3 either)

 

tom

Thomas A. Moulton, W2VY

osCommerce core developer osc2.1 to osc 2.3.x

Support the developers!

http://www.oscommerce.com/about/team

Link to comment
Share on other sites

  • 1 month later...

FedEx has finally given me some useful information about SmartPost

 

1. You are using Version 6 of our Rate Available Services Web Service. SmartPost wasn’t supported until Version 7, the current version that was released in August, 2009. It never occurred to me that you might be using an earlier version. I lost my old emails due to a computer meltdown. I didn’t send version 6 samples did I?

 

2. In addition to the standard request information, there is an extra section in the request called the SmartPostDetail that was added to version 7. It provides the extra detail needed for SmartPost to find a matching service. I have attached a sample XML request and reply that is similar to what you requested so you can see what the SmartPost Detail looks like. As you can see, the SmartPostDetail goes between the recipient and payment information.

 

 

As an FYI, your HubID in production will be (get 4 digit HubID from FedEx).

 

My request includes far less data than yours, which is not a problem. You can send as much information as you wish. I just wanted to demonstrate the SmartPostDetail.

 

 

Here are the required options for SmartPost with Rate Available Services:

 

-  SmartPost is supported for a single Rate or as part of Rate Available Services
-  The SmartPostDetail is added to the request to provide enough information to generate a rate.  It consists of the following fields.
	-  Indicia.  Valid values are:
		-  PRESORTED_STANDARD
			-  packages less than 1 lb.
			-  greater than 1 lb use PARCEL_SELECT
		-  PARCEL_SELECT
			-  packages from 1 to 70 lbs
		-  MEDIA_MAIL
			-  packages from 1 to 70 lbs
			-  Books, DVDs, CDs, videotapes
		-  PRESORTED_BOUND_PRINTED_MATTER
			-  packages from 1 to 15 lbs
			-  catalogs, phone books or anything permanently bound
	-  Ancillary Endorsements.  Valid values are:
		-  ADDRESS_CORRECTION
		-  CARRIER_LEAVE_IF_NO_RESPONSE
		-  CHANGE_SERVICE
		-  FORWARDING_SERVICE
		-  RETURN_DELIVERY
	-  Special Service.  The valid value is
		-  USPS_DELIVERY_CONFIRMATION
			-  The Post Office makes a final delivery scan.  The record shows on the fedex.com tracking scan
	-  HubID
		-  The SmartPost hub the package will go to for sorting.
			-  Numeric value works only.
			-  The value for all the Test Keys is 5531
			-  You will be assigned a Production Hub ID when your account is set up by the SmartPost Onboarding Team.
	-  CustomerManifestID
		-  This optional field is used mostly by large shippers who fill multiple trucks with packages before FedEx takes them away.  This helps determine which truck a package is on.
			-  From the Developer Guide:  The Customer manifest ID  is used to group SmartPost packages onto a manifest for each trailer that is being prepared.  If you have multiple trailers, a ManifestID must be assigned to each SmartPost package as determined by its trailer.  The ManifestID must be unique to you account number for a minimum of 6 months and cannot exceed 8 characters in length.
			-  We recommend you use the day of the year and a trailer ID (a sequential number for that trailer for the day).  For example, if there are three trailers you started loading on February 10th the three manifest Ids would be 041001, 041002, 041003 (this example includes leading zeros on the trailer numbers).

 

I will be modifying this module to:

- Support version 7 of FedEx WSDL

- Integrate SmartPostDetail

- Get cart weight for accurate rates

 

I'll post an update when complete

Link to comment
Share on other sites

  • 5 months later...

I got the module on to running on v2.2rc2 after switching to a live fedex account. Apparently the test server is having problems.

 

I made the changes suggested by UCK above and it works sort of. No matter which Fedex button I select it uses the top one.

 

Has anyone got this to work? The next module to receive the information from fedex_module.php is checkout_confirmation.php

 

I still am struggling to make it work.

 

Please respond if you have ideas how to fix this problem or a complete copy that works. I will post any code you would like to see so you can help make this work.

 

What I learned in the process.

 

1. No instructions

Just FTP the file into oscommerce in the same director as there are unzipped to on your pc.

 

2. According to one post this is not a convert to v3 because of some command that is not used in v3

 

3. ERROR Cannot connect.

Two possible reasons. First you have get a real account from fedex. It only cost when you actual ship. The test server is flaky.

Second, Check you server. Mine has Outgoing Connections Manager which allows you to specify certain IPs or IP ranges to which you will be able to open outgoing connections. Until I Unblocked fedex ip’s I was not allowed to connect.

 

3. ERROR no authentications. Use password sent with email of account # It's 30+ characters. Not your log onto the fedex web site.

 

4. The change uck suggested to fedex_module.php is on line 167.

 

5. We need this version to work because Fedex is scheduled to stop using the old way of suppling rates.

 

Hope this helps.

Edited by larrys-store
Link to comment
Share on other sites

  • 3 weeks later...

Has anyone else received this error:

 

Fatal error: Class 'SoapClient' not found in ////includes/modules/shipping/fedex_module.php on line 37

 

I checked the file against the one uckc posted and it looks the same. Any ideas?

 

Nevermind. I figured out what was wrong. Don't mind the noob.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...