I'm working on a Drupal module that needs to access the line items in a Drupal Commerce Shopping Cart. On most carts, there is a "line items" table of some sort that is linked to the cart via an unique cart id.
However, Drupal Commerce uses "Entities" which effectively obfuscate the relationship between the shopping cart id, the line items, the products and their prices. If you've played around with it at all, then you understand my pain when seeing the "revision" tables and how the data could exist in one of a dozen tables and requiring complex joins that would break if (when) the client upgrades their Commerce module.
I know there is a way to query entities, but I haven't found adequate explanations for using those queries with Drupal Commerce to allow me to pull line items and pricing from a cart. I keep running into Ubercart documentation which is close, but doesn't use entities.
Does anyone know where there is documentation on doing Entity queries (particularly with Drupal Commerce)? Better yet, do you have a query in your pocket that can pull cart contents, and line item pricing?