It's currently impossible to make changes to product entries or add extra information (such as links containing user ID) to the order product table. I've patched Ubercart to do this so that the order_uid field of each product is set. The only alternative to doing this is to have the entire order being passed to theme functions.

It's fairly heavyweight to call uc_order_load() because of the lack of caching.

Patch to follow.

CommentFileSizeAuthor
#1 511958_200907061818-0400.patch610 bytessammys

Comments

sammys’s picture

Status: Active » Needs review
StatusFileSize
new610 bytes

Patch attached

cha0s’s picture

Dependency injection! Me likey.

rszrama’s picture

Would it be helpful to have any other information in here? i.e. the order ID. : ?

If not, I'm happy to commit as is; I do kind of wonder if it should be $product->uid instead of $product->order_uid, but without a strong case in favor of ->uid I'd just leave it alone.

sammys’s picture

I'm thinking it's important to distinguish the product node uid from the order uid. I can't think of anything else that needs to be there. Can I suggest we add them as needed?

Some of this would be moot if we had order caching of some sort as well though I still don't like the heavy weight of stack usage for something simple like the order ID.

rszrama’s picture

Status: Needs review » Fixed

Committed as is.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.