Display Order Total Components as separate fields.

Hello, New to Drupal 7 and Commerce, but experienced with Drupal 6 and Ubercart. Sorry, if this isn't the correct place to post this question.

Would anyone know a way to display each individual component of the order total as it's own field in a view? Either by replacement pattern or php code to show that individual component for the order total?

I am setting up some views to show Sales Reports for the Commerce sales. Specifically using the views to export to a CSV file will all the order details. I have things working pretty good, however I'm struggling with showing the order total components (instead of just the full order total).

So I have a field in my view to show "Commerce Order: Order total". When I have the Formatter set to "Formatted amount" I get the full total as a $ amount. If I set it to "Formatted Amount with Components", it outputs a table with Subtotal, Shipping, Tax, Order Total (similar to what I see in the order view). My main problem is that table doesn't export to CSV (it just leaves the column blank). All though, I would rather have each individual item show in it's own column.

I have played with the Commerce Reporting module but it isn't really outputting what I need. Thanks for any help you can provide.

Posted: Oct 3, 2012


jberg1 on October 8, 2012

Just wondering if anyone has an idea for this? Trying to create a CSV file export that lists all the details of a date range of orders. Got it working expect it won't separate the Order Total into Subtotal, Shipping, Tax, Discount, Order total. It just lists the full order total that includes all these components.

I found this post about utilizing the commerce_price_component_total() to find that. But I don't know how I would go about using this.

Thanks for any help.