VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Shipping VM 1.1 => FedEx VM 1 => Topic started by: harty83 on November 09, 2008, 23:50:03 PM

Title: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on November 09, 2008, 23:50:03 PM
Fedex Shipping Module for VirtueMart 1.1.2
Original Version Copyright:
Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved.
Copyright (c) 2007 Greg Perkins. All rights reserved.
License http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php

Modified Version Copyright:
Copyright (c) 2008 Alan Hartless (hartlessbydesign.com)
License http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php

Description of Changes:
I originally modified the fedex shipping module for VM 1.0 but have just gotten around to making it VM 1.1 compatible.

NOTE THAT THIS IS ALSO A HACK!!

Six new fields have been added to the product form.  These new fields are ship individually, exception dimensions (height, length, width), weight and custom handling fee.  If a product has the ship individually box checked with no exceptions set, it will be packaged by itself.  If it is has the ship individually box checked and exceptions set, then that item will be packaged with other items that add up to the set exception dimensions and/or weight.  All others that have not been set to be packaged alone will be packaged together and broken up into multiple packages if need be to meet Fedex requirements.  Each package is then sent to Fedex to receive a price quote.  The sum of each service for each package plus the handling fees is presented to the customer.

There is also now an optional handling fee specific to the product.  In reality, it costs more to package some items than others.  So, when the packages are created, if an item is set to be packaged by itself, the fee specific to that item will be added to the shipping cost.  If no fee is set on the product page, then the fee from the Fedex config will be added.  If the packaged item has exceptions, the fee for that item will be charged (or the default fee in Fedex config) plus the additional item(s) weight times the extra handling fee which can also be set in Fedex config. For example, let's say there is a main product with a handling fee of $10 and an additional product that weighs 6lbs is going to be packaged with it.  If the extra handling fee in Fedex config is set to $0.50, then the total handling fee to be charged will be $13.  Again this is optional.  Finally all the rest of the items in the cart that has not been packaged yet will be thrown into one or more boxes depending on if the dimensions are within Fedex's limitations.  The handling fee will be the default Fedex fee set in config for the first item plus the item(s) weight times the extra handling fee.

Other options added to the config:

   1) Show/hide store pickup option
   2) Select box with backup shipping module if the application cannot connect to the Fedex server
   3) Option to either give the customer the shippers Fedex discounts or charge the customer the full amount and pocket the discount

How to install:

   1) Download, unpack and upload the contents of the package
   2) Make the following changes to the database (note that if you changed the default prefix from "jos_", make sure you change it below to match your custom prefix!):
      ALTER TABLE `jos_vm_product` ADD `product_handling_fee` DECIMAL(10,4) NULL;
      ALTER TABLE `jos_vm_product` ADD `product_exception_l` DECIMAL(10,4) NULL;
      ALTER TABLE `jos_vm_product` ADD `product_exception_h` DECIMAL(10,4) NULL;
      ALTER TABLE `jos_vm_product` ADD `product_exception_w` DECIMAL(10,4) NULL;
      ALTER TABLE `jos_vm_product` ADD `product_exception_weight` DECIMAL(10,4) NULL;
      ALTER TABLE `jos_vm_product` ADD `product_ship_alone` CHAR(1) NULL;
      
   3) Go to the VM Control Panel and click on Admin -> Manage User Fields -> New
      a. Select "radio" as the field type.
      b. Name the fields the following:
         Field Name -> vm_addresstype
         Field Title -> Address Type
         Description -> Is the address residential or business?
         Select "Yes" for required, show in registration form, show in account maintenance, show in shipping form, and published.
      c. Create the following values
         (title)          (value)
         Residential ->   residential
         Business    ->   business
      d. Save
   4) Configure the fedex module and setup your products

Note: The archive contains all original files for 1.1.2 along with modified files.

Download: http://hartlessbydesign.com/component/option,com_rokdownloads/Itemid,199/id,122/view,file/ (http://hartlessbydesign.com/component/option,com_rokdownloads/Itemid,199/id,122/view,file/)
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: shantzy on November 12, 2008, 04:20:15 AM
THANK YOU! This solves all of my fedex problems for virtuemart ... I finally get ground shipping (in Canada!). Note: to make it work in 1.5 you need to enable legacy mode!
If you don't know how to do this, here is a link:
http://www.mydigitallife.info/2007/11/29/how-to-enable-legacy-mode-in-joomla-15/
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on November 12, 2008, 05:03:45 AM
Quote from: shantzy on November 12, 2008, 04:20:15 AM
THANK YOU! This solves all of my fedex problems for virtuemart ... I finally get ground shipping (in Canada!). Note: to make it work in 1.5 you need to enable legacy mode!
If you don't know how to do this, here is a link:
http://www.mydigitallife.info/2007/11/29/how-to-enable-legacy-mode-in-joomla-15/

You are welcome.  I didn't realize at first it used anything J1.0 but I think I know where the problem is.  When I get time, I will make it both j1.0 and j1.5 compatible so that legacy mode is not necessary.  I'll post when I get it reworked. 

Let me know if you run into any issues.

Thanks!
Alan
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: Lynette on November 25, 2008, 21:27:54 PM
I've applied this hack and it has some nice features and is working well.  I like the ability to mark to ship an item alone and also to mark whether it is a home or business delivery. 

I'm having a problem though with the fact that FedEx uses dimensional weight to figure the shipping rate.  The fedex module only sends the weight to the server.

Is there any hack that will send the dimensions to the fedex server as well?

Sometimes on international packages, the difference between the rate with and without the package dimensions can be between $20 and $40US.  I have to constantly contact intl customers to give them the actual shipping rates.

Can this be done?

Lynette
CycleZone
www.cyclezoneinc.com
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on November 25, 2008, 21:53:59 PM
I'm glad this is useful for you!

There should be setting in the fedex config to base price on dimensions and weight or weight alone. 

Let me know if that doesn't work.

Alan
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: Lynette on November 25, 2008, 22:05:34 PM
Yes, I somehow missed that in the fedex module, but I have it set properly now and it is still calculating the same amounts.
I've cleared the cache on my browser and checked IE and FF just to make sure I wasn't seeing old info.
On a 12.2 lb package, size  24 x 8 x 19 inches to Norway the rate being shown for FedEx international priority is $70.71 when in reality the shipping fees are $146.89.
*** I just noticed that when I enter the product dimensions and weight in VM, it says that it is updated, but if I pull the product up again, then they are blank.  A product that I entered dimensions for yesterday still has it's measurements in. But the one I'm working with now can't seem to save.
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on November 25, 2008, 22:56:39 PM
Quote from: Lynette on November 25, 2008, 22:05:34 PM
Yes, I somehow missed that in the fedex module, but I have it set properly now and it is still calculating the same amounts.
I've cleared the cache on my browser and checked IE and FF just to make sure I wasn't seeing old info.
On a 12.2 lb package, size  24 x 8 x 19 inches to Norway the rate being shown for FedEx international priority is $70.71 when in reality the shipping fees are $146.89.
*** I just noticed that when I enter the product dimensions and weight in VM, it says that it is updated, but if I pull the product up again, then they are blank.  A product that I entered dimensions for yesterday still has it's measurements in. But the one I'm working with now can't seem to save.

I'll take a look into it.  I'm quite busy at the moment but hope to have a fix within a couple days.  Sorry I can't get to it right away!
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: Lynette on November 26, 2008, 02:34:42 AM
The site is just a test site so I started from scratch, reinstalled VM, reapplied the hack and database changes and now it is allowing me to save products properly again. 

It does appear to be figuring higher shipping if I have marked to calculate based on weight and dimension.

However, the rate is almost double what the actual rate was when i shipped a package of the the same weight and size yesterday.

My shipping to Noway on a 24 x 19 x 8 package of 12.2lbs was $148US
With those same dimensions in the VM product with the hack applied, the rate came up as $269US

Is there a setting somewhere that I've marked that would make the rate go that much higher?
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: Lynette on November 26, 2008, 17:40:56 PM
OK - I feel like such an idiot, but maybe it will help someone else from making the same mistake.  The reason the rates looked so much higher to me is that I see our discount rates from our fedex server at the store - I didn't mark that box int he shipping module.  Once I updated the shipping module, the shipping rate was correct! 

Sorry for the hastle - I'm so happy that this works!  It is going to make my job easier because the rates quoted will be correct now.

THANK YOU THANK YOU THANK YOU!
Lynette
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on November 27, 2008, 05:51:45 AM
Quote from: Lynette on November 26, 2008, 17:40:56 PM
OK - I feel like such an idiot, but maybe it will help someone else from making the same mistake.  The reason the rates looked so much higher to me is that I see our discount rates from our fedex server at the store - I didn't mark that box int he shipping module.  Once I updated the shipping module, the shipping rate was correct! 

Sorry for the hastle - I'm so happy that this works!  It is going to make my job easier because the rates quoted will be correct now.

THANK YOU THANK YOU THANK YOU!
Lynette

No need to feel like an idiot.  I'm glad you figured it out! 

Let me know if you run into any other problems!

Alan
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: madscience on November 29, 2008, 00:25:31 AM
i think you have to know how to code to do this correct?
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on November 29, 2008, 00:39:53 AM
Quote from: madscience on November 29, 2008, 00:25:31 AM
i think you have to know how to code to do this correct?

No, you don't really. I saw your previous post.  What do you mean locked out exactly?  Can you not get to your site?  Are modules not showing up?  Are you getting errors?

How did you add the mentioned queries to your database?

Please give me some other information so that hopefully we can get this worked out.

Sincerely,
Alan
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: madscience on December 03, 2008, 08:11:02 AM
Well, I have two sites with the same install of Joom and Virtue,
i went back to the other site and just mirrored the module permission
check marks and i got back to being able to view my products.
There is no where that I can find where there is a clear explination of
what those check marks represent... can't really get my head around it either...

I was getting the "you do not have the correct permissions to access this module" or somthing close to that effect.... I could get into my site, I just couldn't view my products. but if I logged into my front end I could view all the products.

Thanks for your time.
*Mad
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on December 07, 2008, 07:24:56 AM
Quote from: madscience on December 03, 2008, 08:11:02 AM
Well, I have two sites with the same install of Joom and Virtue,
i went back to the other site and just mirrored the module permission
check marks and i got back to being able to view my products.
There is no where that I can find where there is a clear explination of
what those check marks represent... can't really get my head around it either...
I was getting the "you do not have the correct permissions to access this module" or somthing close to that effect.... I could get into my site, I just couldn't view my products. but if I logged into my front end I could view all the products.
Thanks for your time.
*Mad

Mad,

I'm sorry for the delay in responding.  I've been a bit tied up.  Were you able to solve your problem?

Alan
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: monoe on December 27, 2008, 09:45:38 AM

Since I installed modified fedEx shipping over J!1.5 & VM1.1.2, On my frontend all of the thumbnail image product doesn't show...
Need your advise pls...

Rgds

monoe
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on December 27, 2008, 10:59:45 AM
Quote from: monoe on December 27, 2008, 09:45:38 AM
Since I installed modified fedEx shipping over J!1.5 & VM1.1.2, On my frontend all of the thumbnail image product doesn't show...
Need your advise pls...
Rgds
monoe

Hi monoe,

I haven't come across this issue before.  Would you be willing to PM me your site and an account I can login and take a look?

Thanks!
Alan
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: jmatz on January 05, 2009, 21:29:46 PM
I've configured as indicated in the install instructions.

When I view the product in order to set the dimensions, etc., the six fields that were added to the Product dimensions and weight by the modified FedEx files don't have any labels next to them.  (See attached screen grab).

This might explain why the rate that the module is grabbing from the FedEx servers is now much higher than it was before I added the hack.

Any ideas?

Thanks!

[attachment cleanup by admin]
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on January 05, 2009, 21:50:09 PM
Quote from: jmatz on January 05, 2009, 21:29:46 PM
I've configured as indicated in the install instructions.
When I view the product in order to set the dimensions, etc., the six fields that were added to the Product dimensions and weight by the modified FedEx files don't have any labels next to them.  (See attached screen grab).
This might explain why the rate that the module is grabbing from the FedEx servers is now much higher than it was before I added the hack.
Any ideas?
Thanks!

Looks like the language file did not get copied over.  Did you overwrite the existing one or manually edited it?

Thanks,
Alan
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: jmatz on January 05, 2009, 22:00:41 PM
Thanks Alan.  That was the problem.  Only copied SOME of the language files over, not all of them.

Still getting a higher quote for shipping than I was before the update, but will investigate some of the settings and see what the problem might be.  The business/residential checkbox in the user registration works great - adds the residential surcharge as it should.  But there's still about $4 of extra charge in there that I can't identify.  Maybe a larger fuel surcharge? Hmmm....
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: harty83 on January 05, 2009, 22:40:14 PM
Quote from: jmatz on January 05, 2009, 22:00:41 PM
Thanks Alan.  That was the problem.  Only copied SOME of the language files over, not all of them.
Still getting a higher quote for shipping than I was before the update, but will investigate some of the settings and see what the problem might be.  The business/residential checkbox in the user registration works great - adds the residential surcharge as it should.  But there's still about $4 of extra charge in there that I can't identify.  Maybe a larger fuel surcharge? Hmmm....

Is the quote given $4 higher than the previous fedex shipping module quote or a quote given by fedex.com?  If the previous module, try going through fedex.com to get a quote and compare that to the one given by this module. 

Thanks,
Alan
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: jmatz on January 05, 2009, 23:21:45 PM
Quote from: harty83 on January 05, 2009, 22:40:14 PM
Quote from: jmatz on January 05, 2009, 22:00:41 PM
Thanks Alan.  That was the problem.  Only copied SOME of the language files over, not all of them.
Still getting a higher quote for shipping than I was before the update, but will investigate some of the settings and see what the problem might be.  The business/residential checkbox in the user registration works great - adds the residential surcharge as it should.  But there's still about $4 of extra charge in there that I can't identify.  Maybe a larger fuel surcharge? Hmmm....

Is the quote given $4 higher than the previous fedex shipping module quote or a quote given by fedex.com?  If the previous module, try going through fedex.com to get a quote and compare that to the one given by this module. 
Thanks,
Alan

Here is a comparison:
FedEx Site, under "Ship... Get Rates & Transit Time":
from zip:  46250
to zip:  60605
weight:  .5 lb (8 ounces)
value:  $0.00
Calculated Base Amount:  $13.95
Calculated residential surcharge: $2.40
Calculated fuel surcharge: $1.23
Total:  $17.58

VirtueMart 1.1.2 Cart, using FedEx shipping module update 20081109
from zip:  46250 (from the store information in admin)
to zip: 60605
weight: 8 ounces
value: --
Calculated Amount to my residential address:  $20.75
Calculated Amount to my business address:  $18.17

So, the difference of $3.17 to a residential address must be coming from something in the product configuration, I guess.  Not sure how the "Ship alone" and "Exceptions" will affect this, but I have it set to ship alone, with a L,W,H setting of zero for all, weight of 1lb. (it won't take a weight less than that).  I have the Handling fee set to "0" and the Extra handling fee set to "0".  FedEx quote based on Weight Only.

Difference between residential and business address should be $2.40 (based on the FedEx site calculation), but as you can see above, the difference is $2.58
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: WebJIVE on January 15, 2009, 18:48:48 PM
This worked like a CHARM for me.  THANK YOU!

The funny thing was I chased a UPS solution for days and FedEx wound up being cheaper to ship with than UPS for these heavy bulky items.
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: cliffclof on March 14, 2009, 09:25:57 AM
This is very nice.  I'd like to see a little advancement in the future so that you can choose to only add height to the package instead of length and width and height.  This would help when packaging multiple small items together with one large item.  That may not be the correct option.  I understand this would add a horrific amount of coding though.

One more thing.  If you are United States based I noticed that a line of code in (i think) all FedEXdc modules by 'Jay Powers / Soeren Eberhardt / Greg Perkins' and maybe others needs to change to include Canada as an international shipping destination.

The line is in classes/shipping/fedex.php on line 98

$domestic_delivery = ($recipient_country == 'US' || $recipient_country == 'CA') ? true : false;


change to:

$domestic_delivery = ($recipient_country == 'US' /* || $recipient_country == 'CA' */ ) ? true : false;


If I missed something here please let me know.  Thanks.

Great Job!  I hope to see a unified solution for all types of FedEx shipping options come on the scene and this looks like it has the best features.

Oh and PLEASE let me know when it is available for J! 1.5.  I hate that legacy thing being on.  My sleep is altered when I know it's on.
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: ilovenaps on April 21, 2009, 18:42:49 PM
does this work with VM 1.1.3 ?

Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: ilovenaps on April 22, 2009, 19:01:54 PM
Anyone who wants to make a little money to be on chat and email to help walk me through installing this on VM 1.1.3 please email or instant message me.

Easy money!
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: ilovenaps on April 30, 2009, 04:35:58 AM
Followed the instructions....and I get this error:


Please select a Shipping Method!
Direct Access to this location is not allowed.

Anyone ?

The support on this forum doesn't seem to be as good as it used too.
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: kthackston on June 17, 2009, 01:47:48 AM
Quote from: ilovenaps on April 30, 2009, 04:35:58 AM
Followed the instructions....and I get this error:


Please select a Shipping Method!
Direct Access to this location is not allowed.

Anyone ?

The support on this forum doesn't seem to be as good as it used too.

Turn on legacy mode and this will go away and work
Title: Re: Modified fedex shipping mod to retrieve quote based on packages
Post by: kthackston on June 17, 2009, 04:47:18 AM
FedEx Ground only displays if the customer has chosen BUSINESS for their address, over Residential. Residential defaults to Home Delivery.

How can I alter the code so that Residential behaves exactly like Business? Calling ALL my choices, starting with Ground.

Additionally, the Residential option does not call up my secondary shipping option which is the Standard Shipping with some default choices there.

Please help.