i just upgraded to the latest stable of xcart 4.0.12 and no this hasn't been fixed ever...this is actually extremely easy to fix (although it took me a long time to track down)....i've heard of people paying huge chunks of cash for this simple fix....this works in every version of 4.x that i've tried
as it is...i have it rating them as all seperate boxes but if someone wants i could update the code to put as many items into a box as possible.....
so..here's the code
Before: (file /shipping/mod_UPS.php)
Code:
$query=<<<EOT
<?xml version='1.0'?>
<AccessRequest xml:lang='en-US'>
<AccessLicenseNumber>$UPS_accesskey</AccessLicenseNumber>
<UserId>$UPS_username</UserId>
<Password>$UPS_password</Password>
</AccessRequest>
<?xml version='1.0'?>
<RatingServiceSelectionRequest xml:lang='en-US'>
<FreightCharges>
<CurrencyCode>USD</CurrencyCode>
</FreightCharges>
<Request>
<TransactionReference>
<CustomerContext>Rating and Service</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>Rate</RequestAction>
<RequestOption>shop</RequestOption>
</Request>
<PickupType>
<Code>$pickup_type</Code>
</PickupType>
$customer_classification_query
<Shipment>
<Shipper>
<Address>
<City>$src_city</City>
<PostalCode>$src_zipcode</PostalCode>
<CountryCode>$src_country_code</CountryCode>
</Address>
</Shipper>
<ShipFrom>
<Address>
<City>$src_city</City>
<PostalCode>$src_zipcode</PostalCode>
<CountryCode>$src_country_code</CountryCode>
</Address>
</ShipFrom>
<ShipTo>
<Address>
<City>$dst_city</City>
<PostalCode>$dst_zipcode</PostalCode>
<CountryCode>$dst_country_code</CountryCode>
$residental_flag
</Address>
</ShipTo>
<Package>
<PackagingType>
<Code>$packaging_type</Code>
</PackagingType>
<PackageWeight>
<UnitOfMeasurement>
<Code>$UPS_wunit</Code>
</UnitOfMeasurement>
<Weight>$UPS_weight</Weight>
</PackageWeight>
$dimensions_query
$pkgparams
</Package>
</Shipment>
</RatingServiceSelectionRequest>
EOT;
After:
Code:
$query=<<<EOT
<?xml version='1.0'?>
<AccessRequest xml:lang='en-US'>
<AccessLicenseNumber>$UPS_accesskey</AccessLicenseNumber>
<UserId>$UPS_username</UserId>
<Password>$UPS_password</Password>
</AccessRequest>
<?xml version='1.0'?>
<RatingServiceSelectionRequest xml:lang='en-US'>
<FreightCharges>
<CurrencyCode>USD</CurrencyCode>
</FreightCharges>
<Request>
<TransactionReference>
<CustomerContext>Rating and Service</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>Rate</RequestAction>
<RequestOption>shop</RequestOption>
</Request>
<PickupType>
<Code>$pickup_type</Code>
</PickupType>
$customer_classification_query
<Shipment>
<Shipper>
<Address>
<City>$src_city</City>
<PostalCode>$src_zipcode</PostalCode>
<CountryCode>$src_country_code</CountryCode>
</Address>
</Shipper>
<ShipFrom>
<Address>
<City>$src_city</City>
<PostalCode>$src_zipcode</PostalCode>
<CountryCode>$src_country_code</CountryCode>
</Address>
</ShipFrom>
<ShipTo>
<Address>
<City>$dst_city</City>
<PostalCode>$dst_zipcode</PostalCode>
<CountryCode>$dst_country_code</CountryCode>
$residental_flag
</Address>
</ShipTo>
EOT;
//<? //only in here to make code look nicer in php editor..doesn't affect anything
global $cart;
foreach($cart['products'] as $prodKey => $prodArray)
{
for( $quantity=0; $quantity<$prodArray['amount'];$quantity++)
{
$prodWeight = $prodArray['weight'];
$query .=<<<EOT
<Package>
<PackagingType>
<Code>$packaging_type</Code>
</PackagingType>
<PackageWeight>
<UnitOfMeasurement>
<Code>$UPS_wunit</Code>
</UnitOfMeasurement>
<Weight>$prodWeight</Weight>
</PackageWeight>
$dimensions_query
$pkgparams
</Package>
EOT;
}
}
$query .=<<<EOT
</Shipment>
</RatingServiceSelectionRequest>
EOT;
and the other file
Before: (file cart.php around line 285)
Code:
$cart["products"][]=array("cartid"=>$cartid, "productid"=>$productid,"amount"=>$amount, "options"=>$product_options, "free_price"=>@price_format(@$free_price),"distribution"=>$product_distribution);
After:
Code:
$cart["products"][]=array("cartid"=>$cartid, "productid"=>$productid,"amount"=>$amount, "options"=>$product_options, "weight"=>$added_product["weight"], "free_price"=>@price_format(@$free_price),"distribution"=>$product_distribution);
Hope this helps, if you have any problems just drop me a message.
- Nick