I have a view that lists the (ubercart) orders of a user. I created a view for that with a filter applied: "User: current". This works perfectly this way, I use this view in my profile page template like this:

$view = views_get_view('user_orders_custom');
$result = $view->execute_display('default', array($account->uid));

My problem is that when admin is inspecting the profile page of a user, this lists the orders of the admin, not the user being watched. Of course the passed $account->uid is not used by the applied views filter User:current.

I don't know how to make my view filter on the passed uid. I tried creating a relationship, arguments but the filter thing is not clear to me.

  • the question is still open, any help appreciated.. :-) – jabal Oct 22 '11 at 21:49

May be what you need is contextual filters, the user can go to view-name/% where % is a contextual filter for the uid

  • Not exactly, but thanks for the tip. I forgot to mention that I am using Drupal 6 where this module is not available afaik. – jabal Oct 23 '11 at 17:03
  • @jabal: oh, I am a bit of drupal 7 only. But I think pathauto might help. – karthik Oct 24 '11 at 5:39

The solution is: removing filter User:current and adding argument (Order user) Ubercart order: User ID.

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.