Forums / General Questions / Fatal Error on Shipping Estimator

Fatal Error on Shipping Estimator

Views: 805

Results 1 to 3 of 3
4 Jan 2011, 6:26 PM
#1
margecc avatar

margecc

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

28 Jan 2011, 7:41 PM
#2
margecc avatar

margecc

Zen Follower

Join Date:
Feb 2007
Location:
Ontario, Canada
Posts:
234
Plugin Contributions:
0

Re: Fatal Error on Shipping Estimator

Anyone?

Thanks, Colleen
www.af-company.com
To err is human, but to really foul things up requires a computer. Farmers' Almanac, 1978

5 Aug 2019, 3:43 PM
#3
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Fatal Error on Shipping Estimator

**Margecc **could you please email or PM me. I am working with Canpar to build a new shipping module for 1.55f + right now - using their new connection requirements - and I have experienced some of these problems with the old/publicly available Canpar modules.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian