News:

Support the VirtueMart project and become a member

Main Menu

Fedex Module? Why not?

Started by antcomp, January 09, 2006, 07:38:31 AM

Previous topic - Next topic

antcomp

I an able to install it but on the configuration screen the firt box is filled with x's and there are no labels for the form boxes. Also if I enter my account number  and the URI I get errors regarding meter numbers, weight, and others.

Soeren

Hello,

good to hear that it's working.
Some language variables must be added to the language file, that's correct.
Here they are:

var $_VM_FEDEX_ACCOUNT_NUMBER = 'FedEx Account Number';
var $_VM_FEDEX_METER_NUMBER = 'FedEx Meter Number';
var $_VM_FEDEX_METER_NUMBER_TIP = 'The meter number you have received from FedEx';
var $_VM_FEDEX_URI = 'FedEx Server Address';
var $_VM_FEDEX_URI_TIP = 'Per FedEx request the addresses to FedEx\'s API servers are not included (FEDEX_URI). Please register with FedEx to receive this information (<a href="http://www.fedex.com/globaldeveloper/shipapi/">www.fedex.com/globaldeveloper/shipapi/</a>).
<br/>Default for testing is: <strong>https://gatewaybeta.fedex.com/GatewayDC</strong>';


A maintainer for this class would have to care for bug which have been found and fix them. Nothing "big", but it requires skills at PHP/MySQL/Joomla/VirtueMart.

ciao, Soeren
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

rightminddesigns

#17
Quote from: webgobe on January 27, 2006, 21:34:08 PM
The module is working, there are some small issues - I solved for myself, but for inclusion in VirtueMar these need to be addressed:
1. In VM lang file must be added the following tokens:
FEDEX_ACCOUNT_NUMBER
FEDEX_METER_NUMBER
FEDEX_URI

2. Also in Shipping Carrier selection screen during the checkout the carrier name does not displays, but in the rest of the pages is present (Order confirmation page, e-mail etc.

Thanks for the great piece!
You can see it live here: http://www.tofutorch.com/index.php
How do I add the tokens to the language file? I put this at about line 1448 with the others, but obviously I am missing a step somewhere because it gave an error:

Also, how did you fix #2? Not sure if it is an issue for me or not, but I may know soon... :)

...never mind this question...I somehow missed the post from Soeren. :-\

holsum

You place the new language varibales before the } class phpShopLanguage extends vmLanguage { } in the langage.php file.

New question::  Once a customer places an order how do you use the Fedex Shipping API to print your labels?  I use this feature sucessfully in OsCommerce and I am very excited to see its creation here in Virtuecart.  I just am trying to test it out before I convert.

-Holsum

rightminddesigns

I am working on getting this working and am getting this error where the shipping would be selected:

Error: FedEx Return Error F01F : Invalid weight type.

I checked and from what I can tell, the weight type is assigned 'LBS', which according to FedEx is correct. Is there a way I can print the string being sent to FedEx on the screen to enable me to get some help from their tech support? I don't know how to do it in PHP, or I would write it myself. :) (I knew learning ASP would come back to bite me! lol)

Or, if anyone else got the same error...how did you resolve it?

Thanks in advance!

rightminddesigns

I fixed my error problem. In administrator/components/com_virtuemart/classes/shipping/fedex.php, I changed it to manually set the weight type:

Change line 72 from this:
'weight_units' => WEIGHT_UOM.'S'


to this:
'weight_units' => 'LBS'


I had tried setting the WEIGHT_UOM to 'LB', 'LBS', and even 'pounds' and none of those worked. Manually setting it on that line seems to have taken care of the issue. Although...I am still on FedEx's testing servers.  ;)

sesheridan

Hi:   Can you guys put up your current iteration of the fedex module with all the changes incorporated?  I would lilke to give it a try.

Thanks.

rightminddesigns

I am not getting the correct rates returned from FedEx. For example, it is saying a Ground package weighing 3 pounds will ship for 21 cents.

Any idea what the problem could be?



sesheridan, I can give you my latest files if you are still in need (if you want to try them). There are not a lot of changes that need to be made. Just add the new variables to the language file that Soeren posted January 28. And if you get the "Invalid Weight Type" error that I got, you can make the same change I listed on February 13. Good luck! :)

tomcat8118

same problem here with the weights.  also, did anyone solve how to add "fedex" before the shipping so customers know which service they are going with?

rightminddesigns

tomcat, I changed the language file because I am using exclusively FedEx: "Please select a FedEx Shipping Priority:".

And I did get a direction from the FedEx class mailing list:
QuoteYou might want to check what value VirtueMart is using for the quote?  There are a few different ones.
i.e. Total Charge, Discount, Net Charge, etc...

However, I was not able to find where VirtueMart is telling FedEx this value. Maybe Soeren or someone else can shed some light on this?

antcomp

for the rate issue. check to make sure first of all that virtuemart has the correct address entered in (I'm not sure but if your contact address in still set to the demo address this may cause issues. Also fedex mentioned something about a base rate code. If someone can code the script so that you can enter transactions tag by tag in the admin panel and also have it set up so the values are saved in a text file. Then Fedex techsupport could help us out more. They need all the tag data for any transaction weather the cart generated the data automatically or if we enter it in ourselves. This way the tech can enter the same data in on their end to see what they get.

rightminddesigns

Quote from: antcomp on February 25, 2006, 01:05:24 AM
for the rate issue. check to make sure first of all that virtuemart has the correct address entered in (I'm not sure but if your contact address in still set to the demo address this may cause issues.
Thanks for the suggestion. I did still have the default info, but changing it to the correct info did not make a difference.
QuoteAlso fedex mentioned something about a base rate code. If someone can code the script so that you can enter transactions tag by tag in the admin panel and also have it set up so the values are saved in a text file. Then Fedex techsupport could help us out more. They need all the tag data for any transaction weather the cart generated the data automatically or if we enter it in ourselves. This way the tech can enter the same data in on their end to see what they get.
I would also like to see something like this. Or, if someone can make a suggestion on how to do it...? ;D

rightminddesigns

Just checking to see if anyone is still working on this. I don't know how to create the text file of what is being sent to FedEx, so I am hoping one of the people who are more knowledgeable than me can help us get this working. We seem to be so close, and things have ground to hault. :-\

Anyone?

rightminddesigns

ok...I turned on debugging in the cart, and it actually printed out what I needed to see this tme (it wasn't printing this info before), and I think I can see what the issue is. The value that is being displayed and added as the shipping amount is actually a surcharge (fuel?) amount. This is FedEx Tag #1417-X. And tag #1419-X (net charge amount) is what should  be displayed and used for the total. I don't see where #1419-X is ever assigned to $charge, and there is even tag #1133 in the code, and I can't find that in fedex-tags.php

In looking at /classes/shipping/fedex.php, I think the error is in this code is in the first 5 lines where $charge is assigned:
// Loop through all rates
for ($i=1; $i<=$rate_Ret[1133]; $i++) {
$charge = $rate_Ret['1417-'.$i] + floatval( FEDEX_HANDLINGFEE );
$charge *= $taxrate;
$surcharge = $CURRENCY_DISPLAY->getFullValue($charge);

$shipping_rate_id = urlencode($this->classname."|FedEx|".$fed->service_type($rate_Ret['1274-'.$i])."|".$charge);

$checked = (@$d["shipping_rate_id"] == $shipping_rate_id) ? "checked=\"checked\"" : "";

$html .= "\n<input type=\"radio\" id=\"$shipping_rate_id\" name=\"shipping_rate_id\" $checked value=\"$shipping_rate_id\" />\n";
 
$_SESSION[$shipping_rate_id] = 1;
 
$html .= "<label for=\"$shipping_rate_id\">".$fed->service_type($rate_Ret['1274-'.$i])." ";
$html .= "<strong>(".$surcharge.")</strong>";
if( !empty( $rate_Ret['194-'.$i] ) && !empty($rate_Ret['409-'.$i])) {
$html .= ", expected delivery: ".$rate_Ret['194-'.$i].', '.$rate_Ret['409-'.$i];
}

$html .= "</label><br />";
}
echo $html;
return true;
    }


That code is from line 123 to line 147, for anyone else trying to find it.

Any help would be appreciated! Thanks in advance!

rightminddesigns

I got it working!
;D ;D ;D ;D ;D ;D ;D ;D

I made one simple change in classes/shipping/fedex.php.

Change line #125 from
$charge = $rate_Ret['1417-'.$i] + floatval( FEDEX_HANDLINGFEE );

to
$charge = $rate_Ret['1419-'.$i] + floatval( FEDEX_HANDLINGFEE );


;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D