Drupal Commerce FedEx

Published on Saturday 15, December 2012

We all can love Drupal, and we can just as equally hate it. Often times we find ourself scouring the Internet looking for solutions to our problem, hoping to at least. I just had an interesting time setting up shipping rules for Drupal Commerce and getting it to play nice with the awesome Drupal Commerce FedEx module. This guide is for Drupal Commerce, check out DrupalCommerce.org for more information about it. Before you can think about shipping products there are a few modules you need to have installed. Go and grab Physical Fields and Commerce Physical Product and enable them once added to your Drupal install. You'll be able to assign product weight and dimension fields to products now, which is how the Drupal Commerce FedEx module works its magic. I haven't worked with Drupal since version 3 until a month ago when I had to setup a Drupal 7 Commerce site, so I was just as confused as the rest of the Internet on certain things about Drupal. When it came time to adding the product weight and dimension fields I wasn't quite sure whether to put them on the content type or the product type. andyg5000, the active developer, was extremely helpful and point me in the right direction. You will need to add these fields to the product type and set them for each product variation. I highly recommend setting a default values for your product variation type, or else you will need to configure the dimensions and weights on each variation.

Drupal Commerce FedEx Fields

The content type merely references the product type for user end display. That is why you need to add these fields to the product type. Modify each product variation and input your weights and dimensions. Commerce FedEx API information Okay, the products are set; on to the shipping methods configuration. Head over to the Store Settings -> Shipping. Under the Shipping methods  tab find the FedEx row and click on edit. You will need some FedEx API information, it can be a little difficult and not user friendly in trying to get set up with the information you need. Wait for the email from FedEx as that provides all the information you need, especially the password. I made that mistake by entering the information from the confirmation page and using my account password. FedEx delivery options Here is an example of my setup. I did run into one issue. I originally only had "FedEx Ground" enabled and my system would report no shipping services were enabled yet the module was logging a valid response. However, once I enabled FedEx Ground Home Delivery it worked. Not sure if this is a bug in the module or if FedEx just changed their API response. My FedEx response was returning FedEx Ground as blank, so I would enable both just in case your situation is different than mine. I highly recommend enabling the module to log responses. That way if you're still not getting a shipping service to return you can see if FedEx is authenticated properly, or other errors. I didn't have any special requirements for my shipping, just general shipping services for every product. Developing conditions for shipping can be an adventure of its own that I will let you partake on. Here is the default setting I used. It should come like this out-of-the-box.

Shipping configuration

You should be all set! Add a product to your cart and give it a shot. Note: I had an issue where FedEx was down for certain services, but not home delivery. here is my bug submission with the developers patch. I haven't had the issue happen again, but you're worried I would give the patch a shot.