Magento – ERR (3): Notice: Undefined offset: 1 in app/code/core/Mage/Sales/Model/Order.php on line 1258

ce-1.9.0.1errorlogPHP

In Magento CE 1.9.1.0 I get this message in system.log right when the purchase is completed and the customer is taken to checkout/onepage/success/ (Payment via PayPal in sandbox mode, in case this matters):

ERR (3): Notice: Undefined offset: 1  in app/code/core/Mage/Sales/Model/Order.php on line 1258

Looking at the code in question I see

list($carrierCode, $method) = explode('_', $shippingMethod, 2);
return new Varien_Object(array(
            'carrier_code' => $carrierCode,
            'method'       => $method
        ));

How can I fix that?

Best Answer

I don't know if this will help you anymore as you've asked the question a long time ago, but it's a known magento bug and someone came up with a solution: http://wabism.com/magento-shipmethod-1-6-core-fix/