Discussions

commerce_line_items_quantity returning 0 on every order

Here's the breakdown — I have a Commerce site under development that has one custom product type — everything works fine and dandy except going to the checkout page (as in checkout/%commerce_order) which always redirects to (line 45 of commerce_checkout.pages.inc) because commerce_line_items_quantity always returns 0.

This seems to be because none of my line items return a type value, or at least the entity metadata wrapper doesn't have a type property when the $wrapper->getPropertyInfo() is dpm'd in commerce_line_items_quantity().

If I comment out the drupal_goto('') after this check, the checkout page displays normally and everything can process just fine.

I have never seen this happen before and considered posting this as an issue on the module, but the site under development is also using MongoDB for some secondary data, and we have had issues with fields getting sucked into Mongo and entities having problems —

so... Does anyone have any idea why the line item entity wrapper would not have a type?

Have any of you Commerce guys seen something like this or at least have an inkling if this is a configuration issue or if we should just burn the site down and start over?

Posted: Jun 27, 2013

Comments

Mojiferous on July 8, 2013

Alright, figured this one out — it had nothing to do with Commerce, but rather with ECK and an entity named "token" — since the commerce_line_item->type property is a token, this interfered with entity_metadata_wrapper loading the field correctly. Renaming the ECK entity allowed this to function correctly.