I use Ubercart 2 with Ubercart Views. I'd like to filter orders based on total weight.

It's possible to add total weight as a field, however it is not possible to add this field as a filter. I tried Views PHP Filter using $row->weight but this filter is not picked up (it filters $row->title ok). How can I filter by total weight?


My solution was to add custom php filter and add:

$ord_weight = db_result(db_query("SELECT SUM(qty * weight) FROM {uc_order_products} WHERE order_id = '$row->order_id'"));
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.