Has anyone figured out how to get this to wok in AOM? If you attempt to modify an order, it throws an error:
Invalid argument supplied for foreach() in /xxx/shipping/mod_UPS.php on line 275
I'm assuming that the problem is due to the fact that the products aren't "in the cart" anymore, but rather in an orders table. The section of code that causes the error is:
Code:
EOT;
//<? //only in here to make code look nicer in php editor..doesn't affect anything
global $cart;
$upsmxwt = "150";
if ($UPS_weight >= $upsmxwt)
{
foreach($cart['products'] as $prodKey => $prodArray)
{
for( $quantity=0; $quantity<$prodArray['amount'];$quantity++)
{
$UPS_weight = $prodArray['weight'];
$query .=<<<EOT
<Package>
<PackagingType>
<Code>$packaging_type</Code>
</PackagingType>
<PackageWeight>
<UnitOfMeasurement>
<Code>$UPS_wunit</Code>
</UnitOfMeasurement>
<Weight>$UPS_weight</Weight>
</PackageWeight>
$dimensions_query
$pkgparams
</Package>
EOT;