No replies
tframes's picture
Offline
Joined: 01/08/2013
Juice: 37
Was this information Helpful?

I having trouble wrapping my head around the uc_fedex module. I am trying to implement dimensional weights. I've read some of the forum posts and they have some useful information but I am kind of stuck.

I've also read the README.txt file.

I am using Drupal 6 and the current version of uc_fedex for Drupal 6 (6.x-2.x-dev)

If anyone can help me, I'll send you my .module file and highlight what code I'm currently working on.

This is what I am working on currently:

$package_properties = array(
        'SequenceNumber' => $sequence,
        // New for v10 - what's the proper way to use this?
        'GroupPackageCount' => 1,
        // Weights must be rounded up to nearest integer value.
        'Weight' => array(
          'Value'  => ceil($package->shipweight * $weight_conversion_factor),
          'Units'  => $weight_units,
        ),
        // Lengths must be rounded up to nearest integer value
        // Package size hardwired to 1" x 1" x 1" to force weight-based rates
        'Dimensions' => array(
          'Length' => ceil(max(42.0, 1.0 * $package->quantity) * $length_conversion_factor),
          'Width'  => ceil(42.0 * $length_conversion_factor),
          'Height' => ceil(min(42.0, 1.0 * $package->quantity) * $length_conversion_factor),
          'Units'  => $length_units,
        ),
      );

I think what I have to do is figure out what the products size is and its weight. I understand the formula for dimensional weight, I'm just a little stuck.

Thanks