Tags/topics: 
5
Answers
Vote up!
0
Vote down!

How do I override the page display at user/*/orders/* ?

I need to configure this primary order detail page in my own way and I cannot seem to find where they layout is being setup. It is not a view ( though the table of line items is ).

I would like for page manager to control this page but the page: user/%users/orders/%orders is being used somewhere.

If someone could tell me where to turn off this page so I can manage it internally I would be grateful.

Thanks,
Ravenight

Asked by: Ravenight
on August 31, 2012

Comments

After coming back to this topic and with Josh's answer pointing me in the right direction I found an alternative. You can use Page Manager Existing Pages with Panels and override the default page without touching the code. Very cool and worth looking into. It can also override the login and registration pages too (another issue I was working on).

- Ravenight on January 29, 2013

Hi, I'm using commerce kickstart with panels everywhere so I have to override in panels. I have setup user/%user/orders/%order in page manager existing pages but when I enable the page it doesn't override the url. I disable the page and enable it again and I get this message:

user/%user/orders/%order has not been overridden because the menu item does not exist.

- jajouka on May 31, 2013

5 Answers

Vote up!
4
Vote down!

This took a little bit of code reading, but once I found it, it makes a lot sense. So, let's start at the beginning. We're looking at a specific entity, "Order." You can manage the display of Orders by navigating to admin/commerce/config/order/display and there you can change the view that lists the line items, tweak the order total field, and any other customer profiles you might have defined.

Screenshot: https://www.evernote.com/shard/s218/sh/f483dab6-f0a6-4091-af9e-38db65692...

To override with lots of customizability, this was Ryan's advice:

"That path is defined by the Order UI module. The output for that page is just coming from the normal rendering system for the order entity, which works just like nodes. Probably the easiest thing to do would be to implement a .tpl.php for order pages; that should be possible - or else he can hook into hook_commerce_order_view() and fiddle with the content array + add CSS."

If you wanted to go the .tpl.php route, Devel Themer (http://drupal.org/project/devel_themer) provides this suggested template name: page--user--orders.tpl.php and is using the themes/bartik/templates/page.tpl.php file by default.

EclipseGC responded to the issue of Page Manager not letting you override: "The order url pages won't be usable until a task plugin has been provided for it. Page manager needs a custom plugin to override existing hook_menu defined routes."

Hope that helps!
Josh

Josh Miller
Answer by: Josh Miller
Posted: Oct 8, 2012

Comments

Josh thanx a milion! just what is was looking for.

Cheers,

Maarten
Dutch Drupal & FileMaker fan

- maarten on September 20, 2013
Vote up!
1
Vote down!

Aha, I found the solution. When you clone the normal "Line Items" view which is the one you see for a single order, it is somehow recognized by the Order manage display screen.
http://screencast.com/t/Igmg2FXArCz
This took a while to turn up there.

You can then export the cloned view as a feature and use for display of orders by selecting it in the documented way.

Answer by: eigentor
Posted: Jul 23, 2013
Vote up!
0
Vote down!

Well, I found the Settings in the order display.
But the selection of a view there is limited to the original Line Items view, which cannot be exported via features.

I guess it is hardcoded just as the shopping cart block view?
So does the same method apply as for the shopping cart block if I wanna override it (export it in a custom module with hook_views_default_views_alter ?

Answer by: eigentor
Posted: Jul 23, 2013
Vote up!
0
Vote down!

Hi,

I'm overriding the default order display page and also the order overview page with Page Manager Existing Pages.
Very nice that you can also control these pages in panels now!

It is important that you use the correct paths:

/user/%user/orders/%commerce_order

and

/user/%views_arg/orders

Answer by: Max Acke
Posted: Sep 17, 2015
Vote up!
0
Vote down!

Display Suit does the job. Install the ds module and enable one of the ds layouts on the admin/commerce/config/order/display page. You can make changes in the UI and also in one of the suggested by ds template files.

Answer by: droptimum
Posted: Mar 30, 2016