I'm using the All-in-one shipping quote option and have set the package quantity field correctly for my items. There's no splitting the quote into multiple packages. The quote always returns 1 package. I'm using UPS.

I've verified that this is not working in 6.x-dev as well as 6.x-2.13.

Here's my debug XML using only the UPS Ground option:

UPS logoUPS Ground Rate (1 package): $22.68

<?xml version="1.0" encoding="UTF-8"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>SECRET</AccessLicenseNumber>
  <UserId>SECRET</UserId>
  <Password>SECRET</Password>
</AccessRequest>

<?xml version="1.0" encoding="UTF-8"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>Complex Rate Request</CustomerContext>
      <XpciVersion>1.0001</XpciVersion>
    </TransactionReference>
    <RequestAction>Rate</RequestAction>
    <RequestOption>rate</RequestOption>
  </Request>
  <PickupType>
    <Code>06</Code>
  </PickupType>
  <CustomerClassification>
    <Code>04</Code>
  </CustomerClassification>
  <Shipment>
    <Shipper>
      <ShipperNumber>SECRET</ShipperNumber>
      <Address>
        <City></City>
        <StateProvinceCode></StateProvinceCode>
        <PostalCode></PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
        <StateProvinceCode>NY</StateProvinceCode>
        <PostalCode>10940</PostalCode>
        <CountryCode>US</CountryCode>
      <ResidentialAddressIndicator/>
      </Address>
    </ShipTo>
    <ShipFrom>
      <Address>
        <StateProvinceCode>MD</StateProvinceCode>
        <PostalCode>20737</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </ShipFrom>
    <ShipmentWeight>
      <UnitOfMeasurement>
        <Code>LBS</Code>
        <Description>Pounds</Description>
      </UnitOfMeasurement>
      <Weight>22.8</Weight>
    </ShipmentWeight>
    <Service>
      <Code>03</Code>
      <Description>UPS Ground</Description>
    </Service>
    <Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>14.00</Length><Width>8.00</Width><Height>14.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>22.8</Weight></PackageWeight></Package></Shipment>
</RatingServiceSelectionRequest> 

 <?xml version="1.0"?>
<RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Complex Rate Request</CustomerContext><XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>1</ResponseStatusCode><ResponseStatusDescription>Success</ResponseStatusDescription></Response><RatedShipment><Service><Code>03</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>23.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>22.68</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>22.68</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery/><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>22.68</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>22.68</MonetaryValue></TotalCharges><Weight>22.8</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>23.0</Weight></BillingWeight></RatedPackage></RatedShipment></RatingServiceSelectionResponse>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TR’s picture

Status: Active » Closed (works as designed)

"All in one" means all in one - you will get one package. Package quantity is ignored. The only place package quantity has an effect is when you chose "Each in own".

matthand’s picture

Status: Closed (works as designed) » Active

Thank you for the quick response.

From the quote settings page, here is the instructions concerning quote type:

Indicate whether each product is quoted as shipping separately or all in one package. Orders with one kind of product will still use the package quantity to determine the number of packages needed, however.

That help statement is at odds with the information you're telling me. Also, when I switch to "each in own" it still does not work as designed. Any chance you review this some more please?

Here's the XML debug code while using "each in own" option which also does not split into multiple packages:

UPS logoUPS Ground Rate (1 package): $54.36

<?xml version="1.0" encoding="UTF-8"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>SECRET</AccessLicenseNumber>
  <UserId>SECRET</UserId>
  <Password>SECRET</Password>
</AccessRequest>

<?xml version="1.0" encoding="UTF-8"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>Complex Rate Request</CustomerContext>
      <XpciVersion>1.0001</XpciVersion>
    </TransactionReference>
    <RequestAction>Rate</RequestAction>
    <RequestOption>rate</RequestOption>
  </Request>
  <PickupType>
    <Code>06</Code>
  </PickupType>
  <CustomerClassification>
    <Code>04</Code>
  </CustomerClassification>
  <Shipment>
    <Shipper>
      <ShipperNumber>SECRET</ShipperNumber>
      <Address>
        <City></City>
        <StateProvinceCode></StateProvinceCode>
        <PostalCode></PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
        <StateProvinceCode>NY</StateProvinceCode>
        <PostalCode>10940</PostalCode>
        <CountryCode>US</CountryCode>
      <ResidentialAddressIndicator/>
      </Address>
    </ShipTo>
    <ShipFrom>
      <Address>
        <StateProvinceCode>MD</StateProvinceCode>
        <PostalCode>20737</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </ShipFrom>
    <ShipmentWeight>
      <UnitOfMeasurement>
        <Code>LBS</Code>
        <Description>Pounds</Description>
      </UnitOfMeasurement>
      <Weight>13.6</Weight>
    </ShipmentWeight>
    <Service>
      <Code>03</Code>
      <Description>UPS Ground</Description>
    </Service>
    <Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>2.00</Length><Width>2.00</Width><Height>4.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>4.0</Weight></PackageWeight></Package><Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>14.00</Length><Width>8.00</Width><Height>14.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>3.2</Weight></PackageWeight></Package><Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>14.00</Length><Width>8.00</Width><Height>14.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>3.2</Weight></PackageWeight></Package><Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>14.00</Length><Width>8.00</Width><Height>14.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>3.2</Weight></PackageWeight></Package></Shipment>
</RatingServiceSelectionRequest> 

 <?xml version="1.0"?>
<RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Complex Rate Request</CustomerContext><XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>1</ResponseStatusCode><ResponseStatusDescription>Success</ResponseStatusDescription></Response><RatedShipment><Service><Code>03</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>16.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>54.36</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>54.36</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery/><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TotalCharges><Weight>4.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>4.0</Weight></BillingWeight></RatedPackage><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TotalCharges><Weight>3.2</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>4.0</Weight></BillingWeight></RatedPackage><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TotalCharges><Weight>3.2</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>4.0</Weight></BillingWeight></RatedPackage><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TotalCharges><Weight>3.2</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>4.0</Weight></BillingWeight></RatedPackage></RatedShipment></RatingServiceSelectionResponse>
matthand’s picture

Status: Active » Needs work

Using "Each in own" packing option does correctly submit multiple packages to UPS via the XML Schema. However, the rate information that is displayed to the user prints "1 package" instead of the plural when there is multiple packages. This is confusing.

Here is the function code from the file uc_ups.module that is setting this text (line 723):

/**
 * Theme function to format the UPS service name and rate amount line-item
 * shown to the customer.
 *
 * @param $service
 *   The UPS service name.
 * @param $packages
 *   Package information.
 *
 * @ingroup themeable
 */
function theme_uc_ups_option_label($service, $packages) {
  // Start with logo as required by the UPS terms of service.
  $output  = theme('image',
    drupal_get_path('module', 'uc_ups') . '/uc_ups_logo.gif',
    t('UPS logo'),
    '',
    array('class' => 'ups-logo')
  );

  // Add the UPS service name.
  $output .= t('@service Rate', array('@service' => $service));

  // Add package information
  $output .= ' ('. format_plural(count($packages), '1 package', '@count packages') .')';

  return $output;
}

I think the problem is with line 747:

$output .= ' ('. format_plural(count($packages), '1 package', '@count packages') .')';
matthand’s picture

Title: All-in-one Shipping with Package Quantity not splitting quotes into multiple packages » Each in own Shipping Option with Package Quantity not splitting quotes into multiple packages
Priority: Major » Normal

The issue with line 747 in uc_ups.module is that $packages is an array with one element, so the count always equals 1. So the solution here is to count the qty properly.

Here's a dpm of $packages in label function:

... (Array, 1 element)
    0 (Array, 2 elements)
        0 (Object) stdClass
            nid (String, 1 characters ) 2
            title (String, 13 characters ) Small Product
            model (String, 1 characters ) 1
            qty (Integer) 2
            cost (String, 7 characters ) 3.00000
            price (Float) 175
            weight (Float) 5
            data (Array, 2 elements)
            type (String, 7 characters ) product
            language (String, 0 characters )
            uid (String, 1 characters ) 1
            status (String, 1 characters ) 1
            created (String, 10 characters ) 1399651083
            changed (String, 10 characters ) 1399651083
            comment (String, 1 characters ) 2
            promote (String, 1 characters ) 1
            moderate (String, 1 characters ) 0
            sticky (String, 1 characters ) 0
            tnid (String, 1 characters ) 0
            translate (String, 1 characters ) 0
            vid (String, 1 characters ) 2
            revision_uid (String, 1 characters ) 1
            body (String, 4 characters ) test
            teaser (String, 4 characters ) test
            log (String, 0 characters )
            revision_timestamp (String, 10 characters ) 1399651083
            format (String, 1 characters ) 1
            name (String, 5 characters ) admin
            picture (String, 0 characters )
            list_price (String, 8 characters ) 12.00000
            sell_price (String, 7 characters ) 7.00000
            weight_units (String, 2 characters ) lb
            length (String, 1 characters ) 2
            width (String, 1 characters ) 2
            height (String, 1 characters ) 4
            length_units (String, 2 characters ) in
            pkg_qty (String, 2 characters ) 25
            default_qty (String, 1 characters ) 1
            unique_hash (String, 32 characters ) 813ff1f6b26761640df8c779135b4bdb
            ordering (String, 1 characters ) 0
            shippable (String, 1 characters ) 1
            last_comment_timestamp (String, 10 characters ) 1399651083
            last_comment_name (NULL)
            comment_count (String, 1 characters ) 0
            taxonomy (Array, 0 elements)
            shipping_type (String, 13 characters ) small_package
            shipping_address (Object) stdClass
            ups (Array, 3 elements)
            description (String, 1 characters ) 1
            pkg_type (String, 2 characters ) 02
        1 (Object) stdClass
            nid (String, 1 characters ) 1
            title (String, 19 characters ) Extra Large Product
            model (String, 1 characters ) 2
            qty (Integer) 3
            cost (String, 8 characters ) 12.50000
            price (Float) 30
            weight (Float) 3.2
            data (Array, 2 elements)
            type (String, 7 characters ) product
            language (String, 0 characters )
            uid (String, 1 characters ) 1
            status (String, 1 characters ) 1
            created (String, 10 characters ) 1399650949
            changed (String, 10 characters ) 1399650999
            comment (String, 1 characters ) 0
            promote (String, 1 characters ) 1
            moderate (String, 1 characters ) 0
            sticky (String, 1 characters ) 0
            tnid (String, 1 characters ) 0
            translate (String, 1 characters ) 0
            vid (String, 1 characters ) 1
            revision_uid (String, 1 characters ) 1
            body (String, 13 characters ) Test product.
            teaser (String, 13 characters ) Test product.
            log (String, 0 characters )
            revision_timestamp (String, 10 characters ) 1399650999
            format (String, 1 characters ) 1
            name (String, 5 characters ) admin
            picture (String, 0 characters )
            list_price (String, 8 characters ) 15.00000
            sell_price (String, 8 characters ) 15.00000
            weight_units (String, 2 characters ) lb
            length (String, 2 characters ) 14
            width (String, 1 characters ) 8
            height (String, 2 characters ) 14
            length_units (String, 2 characters ) in
            pkg_qty (String, 1 characters ) 2
            default_qty (String, 1 characters ) 1
            unique_hash (String, 32 characters ) 693b8d7e0ba198741787cd3859228ea7
            ordering (String, 1 characters ) 0
            shippable (String, 1 characters ) 1
            last_comment_timestamp (String, 10 characters ) 1399650949
            last_comment_name (NULL)
            comment_count (String, 1 characters ) 0
            taxonomy (Array, 0 elements)
            shipping_type (String, 13 characters ) small_package
            shipping_address (Object) stdClass
            ups (Array, 3 elements)
            description (String, 1 characters ) 2
            pkg_type (String, 2 characters ) 02
matthand’s picture

Title: Each in own Shipping Option with Package Quantity not splitting quotes into multiple packages » Each in own Shipping Option not displaying proper package count in rate label

I altered the uc_ups.module code to display the number of packages in the rate quote.

New code:

/**
 * Theme function to format the UPS service name and rate amount line-item
 * shown to the customer.
 *
 * @param $service
 *   The UPS service name.
 * @param $packages
 *   Package information.
 *
 * @ingroup themeable
 */
function theme_uc_ups_option_label($service, $packages) {
  $box_count = 0;
  foreach ($packages as $package) {
    foreach($package as $box) {
      $box_count += $box->qty;
    };
  };
  // Start with logo as required by the UPS terms of service.
  $output  = theme('image',
    drupal_get_path('module', 'uc_ups') . '/uc_ups_logo.gif',
    t('UPS logo'),
    '',
    array('class' => 'ups-logo')
  );

  // Add the UPS service name.
  $output .= t('@service Rate', array('@service' => $service));

  // Add package information
  $output .= ' ('. format_plural($box_count, '1 package', '@count packages') .')';

  return $output;
}

It now displays the proper package count now in the quote, see debug code below:

UPS logoUPS Ground Rate (5 packages): $68.47

<?xml version="1.0" encoding="UTF-8"?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>SECRET</AccessLicenseNumber>
  <UserId>SECRET</UserId>
  <Password>SECRET</Password>
</AccessRequest>

<?xml version="1.0" encoding="UTF-8"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>Complex Rate Request</CustomerContext>
      <XpciVersion>1.0001</XpciVersion>
    </TransactionReference>
    <RequestAction>Rate</RequestAction>
    <RequestOption>rate</RequestOption>
  </Request>
  <PickupType>
    <Code>06</Code>
  </PickupType>
  <CustomerClassification>
    <Code>04</Code>
  </CustomerClassification>
  <Shipment>
    <Shipper>
      <ShipperNumber>SECRET</ShipperNumber>
      <Address>
        <City></City>
        <StateProvinceCode></StateProvinceCode>
        <PostalCode></PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
        <StateProvinceCode>NY</StateProvinceCode>
        <PostalCode>10940</PostalCode>
        <CountryCode>US</CountryCode>
      <ResidentialAddressIndicator/>
      </Address>
    </ShipTo>
    <ShipFrom>
      <Address>
        <StateProvinceCode>MD</StateProvinceCode>
        <PostalCode>20737</PostalCode>
        <CountryCode>US</CountryCode>
      </Address>
    </ShipFrom>
    <ShipmentWeight>
      <UnitOfMeasurement>
        <Code>LBS</Code>
        <Description>Pounds</Description>
      </UnitOfMeasurement>
      <Weight>19.6</Weight>
    </ShipmentWeight>
    <Service>
      <Code>03</Code>
      <Description>UPS Ground</Description>
    </Service>
    <Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>2.00</Length><Width>2.00</Width><Height>4.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>5.0</Weight></PackageWeight></Package><Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>2.00</Length><Width>2.00</Width><Height>4.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>5.0</Weight></PackageWeight></Package><Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>14.00</Length><Width>8.00</Width><Height>14.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>3.2</Weight></PackageWeight></Package><Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>14.00</Length><Width>8.00</Width><Height>14.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>3.2</Weight></PackageWeight></Package><Package><PackagingType><Code>02</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>IN</Code></UnitOfMeasurement><Length>14.00</Length><Width>8.00</Width><Height>14.00</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>LBS</Code><Description>Pounds</Description></UnitOfMeasurement><Weight>3.2</Weight></PackageWeight></Package></Shipment>
</RatingServiceSelectionRequest> 

 <?xml version="1.0"?>
<RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Complex Rate Request</CustomerContext><XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>1</ResponseStatusCode><ResponseStatusDescription>Success</ResponseStatusDescription></Response><RatedShipment><Service><Code>03</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>22.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>68.47</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>68.47</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery/><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.85</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.85</MonetaryValue></TotalCharges><Weight>5.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>5.0</Weight></BillingWeight></RatedPackage><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.85</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.85</MonetaryValue></TotalCharges><Weight>5.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>5.0</Weight></BillingWeight></RatedPackage><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TotalCharges><Weight>3.2</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>4.0</Weight></BillingWeight></RatedPackage><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TotalCharges><Weight>3.2</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>4.0</Weight></BillingWeight></RatedPackage><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>13.59</MonetaryValue></TotalCharges><Weight>3.2</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>4.0</Weight></BillingWeight></RatedPackage></RatedShipment></RatingServiceSelectionResponse>
matthand’s picture

Version: 6.x-2.13 » 6.x-2.x-dev
Status: Needs work » Needs review
FileSize
1.03 KB

I made a patch file against the current 6.x-2.x-dev branch with the changes I described above. Feedback?

TR’s picture

Interesting. But I don't think your proposed fix is correct - you are summing the qty values for each subarray, but qty should hold the number of products in the package, not the number of packages. The packages array in #4 looks to me like there are only two packages, but the UPS response in #5 shows five packages - are these two logs for the same order? How many products in the order and how many packages do you expect based on your package quantity settings?

TR’s picture

Status: Needs review » Postponed (maintainer needs more info)
TR’s picture

Version: 6.x-2.x-dev » 8.x-4.x-dev
Component: Shipping » Shipping quotes
Status: Postponed (maintainer needs more info) » Needs work