Zen Follower
- Join Date:
- Feb 2007
- Location:
- Ontario, Canada
- Posts:
- 234
- Plugin Contributions:
- 0
Fatal Error on Shipping Estimator
Well I have a custom shipping option installed, which as far as I knew worked great, until today, when a customer tried the shipping estimator and received a fatal error. Unfortunately, I can't find the guy who wrote it, so I'm really hoping someone can perhaps see an obvious error.
Here is a link to a product just so you can try:
http://transportation.actionforms.ca/cart/index.php?main_page=product_info&cPath=182_187_188_196&products_id=2002
The error received is:
Fatal error: Cannot use object of type shoppingCart as array in /home/actforms/public_html/cart/includes/modules/shipping/canpar.php on line 187
And this is the snip of code that is in that area:
```
$itemCount = 0;
$totalWeight = 0;
if (count($order->products) > 0) {
foreach ($order->products as $pkey=>$pval) {
$totalWeight = $totalWeight + ($pval['weight'] * $pval['qty']);
$itemCount++;
}
} else {
if (array_key_exists("cart", $_SESSION) && count($_SESSION['cart']['contents']) > 1) {
// this might be the shipping estimator
foreach ($_SESSION['cart']['contents'] as $pkey=>$pval) {
$totalWeight = $totalWeight + ($pval['weight'] * $pval['qty']);
$itemCount++;
}
} else {
// return $this->error("You have no items in your cart.");
return $this->error(MODULE_SHIPPING_CANPAR_TEXT_LOGIN);
}
}
It works just fine to actually place an order, just a problem with the estimator. Any help would be appreciated!!!
Thanks, Colleen
www.af-company.com
To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978