Author Topic: Modified fedex shipping mod to retrieve quote based on packages  (Read 28883 times)

harty83

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 63
Modified fedex shipping mod to retrieve quote based on packages
« 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/

shantzy

  • Beginner
  • *
  • Posts: 4
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #1 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/

harty83

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 63
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #2 on: November 12, 2008, 05:03:45 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

Lynette

  • Beginner
  • *
  • Posts: 25
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #3 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

harty83

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 63
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #4 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

Lynette

  • Beginner
  • *
  • Posts: 25
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #5 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.

harty83

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 63
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #6 on: November 25, 2008, 22:56:39 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!

Lynette

  • Beginner
  • *
  • Posts: 25
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #7 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?

Lynette

  • Beginner
  • *
  • Posts: 25
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #8 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

harty83

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 63
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #9 on: November 27, 2008, 05:51:45 am »
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

madscience

  • Jr. Member
  • **
  • Posts: 62
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #10 on: November 29, 2008, 00:25:31 am »
i think you have to know how to code to do this correct?

harty83

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 63
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #11 on: November 29, 2008, 00:39:53 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

madscience

  • Jr. Member
  • **
  • Posts: 62
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #12 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

harty83

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 63
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #13 on: December 07, 2008, 07:24:56 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

monoe

  • Beginner
  • *
  • Posts: 3
Re: Modified fedex shipping mod to retrieve quote based on packages
« Reply #14 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