Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently it seems the relation between orders and uc_node_checkout nodes is stored in the database, but is not exposed in the UI anywhere (except when a uc_node_checkout node is in the shopping cart).
I've attached a patch which does two things:
- Adds an Order Pane to display all of the uc_node_checkout nodes for this order in a bulleted list, linking to the nodes. Ideally this would be integrated into the main "Products" Order Pane, but there doesn't seem to be an API for modifying other modules' Order Panes, and uc_order.module's Order Pane is hardcoded to display only uc_attributes.
- Adds a link from the uc_node_checkout node to the corresponding order (via hook_nodeapi()).
Comment | File | Size | Author |
---|---|---|---|
#8 | 418238_links_between_nodes_and_orders-4.patch | 2.58 KB | jumpfightgo |
#3 | 418238_links_between_nodes_and_orders-3.patch | 2.77 KB | greggles |
#2 | Picture 1.png | 21.26 KB | greggles |
#2 | 418238_links_between_nodes_and_orders.patch | 2.67 KB | greggles |
#1 | uc_node_checkout.module-links-01.patch | 2.21 KB | smokris |
Comments
Comment #1
smokrisfixed link on uc_node_checkout nodes to only appear on uc_node_checkout nodes (oops).
Comment #2
gregglesThis is a great addition. I cleaned up the code a little bit and have attached it to this node.
Also attached is a screenshot of the order screen to demonstrate the value.
Comment #3
gregglesI was patching against the wrong branch. Let's try again...
Comment #4
nicoloconte CreditAttribution: nicoloconte commentedGood woork greggles ;)
Comment #5
KarenS CreditAttribution: KarenS commentedGreat idea, I also notice that the order id is totally buried and inaccessible. I'm wondering how this might relate to #430016: UC Node Checkout should provide a view to query against the related checkout node, I'm thinking that would still be useful as a way to bring order information and registration information together in one view.
Planning to try this out later today.
Comment #6
nicoloconte CreditAttribution: nicoloconte commentedI've a problem: I can see the link "order" in all pages of my site.
Can I remove it? Is it possible?
Thanks
Nicolo'
Comment #7
BenStallings CreditAttribution: BenStallings commentedThank you, Greggles! One change I would make:
to
That way the order link is only shown to users who are authorized to see the order.
Comment #8
jumpfightgo CreditAttribution: jumpfightgo commentedHere's a new patch that works with beta4.
I included the permissions check from BenStallings in comment #7, and also wrapped the link with a span with class "uc-node-checkout-order-link" so themers can style the link as needed.
Let's get this patch applied to the next release!
Comment #9
Eric Link CreditAttribution: Eric Link commentedThanks, just applied this patch and it works great! BTW any reason it isn't in the node checkout module yet, seems like a must have, +1 from me for it. - Eric
Comment #10
bisonbleu CreditAttribution: bisonbleu commentedGreat patch. Just what I was looking for!
One tiny glitch for me, it reintroduces the following error message:
preg_match() expects parameter 2 to be string, array given in /home/myname/public_html/mydrupalinstall/includes/bootstrap.inc on line 777.
for which there is a uc_node_checkout patch here : http://drupal.org/node/548848#comment-2692466. Should they be combined?
Comment #11
Norm Kosty CreditAttribution: Norm Kosty commentedThanks for the patch.
When I click thru, it takes me through as a user view into order. If there is admin status on the active user, is it possible to have an admin store order view instead? or perhaps an edit link?
:O)
Comment #13
ezra-g CreditAttribution: ezra-g commentedI marked #666016: View UC Order from the Node that was Ordered as a duplicate.
Comment #14
geerlingguy CreditAttribution: geerlingguy commentedNice - subscribe.
Comment #15
tchurch CreditAttribution: tchurch commentedsubscribing
Comment #16
christiaan_ CreditAttribution: christiaan_ commentedThank you very much. The patch works for me !
Comment #17
ezra-g CreditAttribution: ezra-g commentedLooks good and works well in my testing.
This is committed - Thanks! http://drupal.org/cvs?commit=441916
Comment #21
griz CreditAttribution: griz commentedUnfortunately the "Order" link shows up in RSS displays created by Views. I actually had no idea there was meant to be a link on the page anyway, having got around that problem with node.tpl.php.
I've commented lines 772 to 779, but is there any way I can do this without having to 'hack'? Such as overriding the function from a module of my own? I've done hook_form_alter and some other dabbling, but not sure how to do this properly.
Also, might I suggest that since it outputs HTML this last part (line 781 - "Link node to the corresponding order") be separated out into a themeable function?