Mohamed Thelji wrote: 1.
In that case the solution will probably be to add that kind of code :
if($v == 'GROUND_HOME_DELIVERY' && !$recipient['Address']['Residential'])
continue;
Just after these lines :if(@$rate->shipping_params->destination_type=='res'){
$recipient['Address']['Residential'] = true;
}
if(@$rate->shipping_params->destination_type=='com' || (@$rate->shipping_params->destination_type=='auto' && $v == 'FEDEX_GROUND')){
$recipient['Address']['Residential'] = false;
}
The problem with that is the FedEx Ground option is always present, as I have customers that ship to a residential address and others that ship to a commercial address. So, I have FedEx Ground and FedEx Ground (Home Delivery) methods enabled via the backend. The above code always ends up with residential set to false. The FedEx plugin should be able to reliably determine if the recipient address is residential or commercial. That should be based on the information provided by the customer. To fix this issue, I created a required custom address field named "Address Type" where the customer must select if their address is commercial or residential. You can see this in the edited plugin that I posted. This is how the FedEx plugin that I used with my old Virtuemart shop worked.
From looking at the UPS plugin (line 527), it uses the address_company field to help in determining if an address is residential or not. There are problems with using that field, which I mentioned earlier, but at least that plugin tries to make that determination. So, why can't the FedEx plugin be changed to do so?
Mohamed Thelji wrote: 2.
That issue is coming from the fact that some shipping services aren't compatible/available with your current FedEx shipping configuration/shipping address/.. to solve it and to use every services, you'll have to create multiple FedEx shipping methods with different configurations for each cases.
This chunk of code should actually be ignoring that message, but isn't.
if(!$notif && !empty($response->Notifications->Message) && $response->Notifications->Message != 'Service is not allowed') {
$app = JFactory::getApplication();
$app->enqueueMessage('The FedEx request failed with the message : ' . $response->Notifications->Message);
}
I had to modify this code to get the "Service is not allowed" and "Customer not eligible for service" messages to be ignored.
if(!$notif && !empty($response->Notifications->Message) && strpos($response->Notifications->Message, 'not allowed') === false && strpos($response->Notifications->Message, 'not eligible') === false) {
$app = JFactory::getApplication();
$app->enqueueMessage('The FedEx request failed with the message : ' . $response->Notifications->Message);
}
It seems strange to me that I would have to develop multiple FedEx shipping methods with different configurations, just to be able to ship to residential vs. commercial addresses. The plugin should be able to handle either scenario.
Mohamed Thelji wrote: 3.
There is actually no option to do that but, sorting FedEx shipping rates will be easy to do by sorting the "$shipment" variable through the "_FEDEXrequestMethods" function.
OK, so please do so. It seems strange to have a shipping plugin that doesn't automatically sort the rates. The customer should not have to pick through the list to see what the cheapest option is. It should be readily apparent.