Closed (fixed)
Project:
Ubercart Views
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2009 at 21:20 UTC
Updated:
21 Jan 2012 at 19:47 UTC
I was asked to export product and order data on a monthly basis, broken down by location, into .csv format, and I've run into an unusual hiccup. Say a branch orders 6 units of staples. I can easily show the per-unit cost for the staples, but there's no easy way to display the total cost spent in that order for all of the staples.
Is this data best generated here? Or finagled in some way as a computed field in CCK? Or is there another way?
Comments
Comment #1
madsph commentedI am not sure but I think this module might help you:
http://drupal.org/project/views_calc
Comment #2
domesticat commentedYou are absolutely right. I forgot that views_calc let you build fields based on mathematical functions performed on other fields. If anyone else comes looking for this feature, you want to go to admin/settings/views_calc and set up the new field to be
(%uc_order_products.price * %uc_order_products.qty)
with a format of "decimal (2)"
Thanks! Marking closed.
Comment #3
CraigBertrand commentedHey guys, sorry to resurrect an old post however views calc is not really working out in my case. I am getting some weird results when using the provided relationships as well as when I try to use uc_order_node relationship.
When I use the ones provided and do a view of "ordered products" create a views calc field like mentioned above. the math looks good on the line item however when using views calc to total sum that field the sum doesn't add up.
When using uc_order_node the calc field doesn't even work just get 0.00. (And I did add the relationship for the field)
Anyhow it would seem to me that it would be use full to just have a field provided to provide a "Ubercart order product: Line Total" field.
Let me know what you think.