I'm getting two of the following error every time I visit a cart page:

Notice: Undefined index: components in commerce_cart_order_refresh() (line 773 of /[my_site]/sites/all/modules/commerce/modules/cart/commerce_cart.module).

This seems to be causing shipping costs to fail to be added as a line item in checkout.

Comments

jaymallison’s picture

I had this same problem after enabling commerce shipping 2.x. I realized it was old items in my cart that I had added before enabling the module. After clearing the cart and then re-adding new products, the error went away.

rszrama’s picture

Status: Active » Fixed

There appears to be something deficient in the Shipping module that's preventing shipping line item unit prices from getting their proper components. I'm digging deeper there, and in the meantime I've committed the following fix to Commerce itself to prevent the absence of unit price components from throwing errors here in the refresh. It's a bit of a red herring when it comes to actually determining the issue.

Commit: http://drupalcode.org/project/commerce.git/commitdiff/1eccb6b

rszrama’s picture

Project: Commerce Core » Commerce Shipping
Version: 7.x-1.x-dev » 7.x-2.x-dev
Component: Cart » Code

And now moving this to the Shipping module for the fix; I had introduced an empty() check on the wrong variable (a data array instead of a components array inside that data array) when I was working on VAT inclusive flat rates. This was giving a false negative, preventing the default price component from being added to shipping line item unit prices. Fix is in the commit.

Commit: http://drupalcode.org/project/commerce_shipping.git/commitdiff/d476884

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.