views:

72

answers:

2

Hello

I am working on an Ubercart installation on a Drupal site we are producing. Everything is going smoothly, but I am now trying to setup the order page template (uc_order module), so that the frontend developers can style it up.

The page is the one you view when you go to user/[UID]/order/[ORDER-ID].

I understand how to use hooks, preprocess, theming and template fuctions within Drupal, but currently I cannot see a way of changing any of the markup on the "order panes" that make up the page. It goes without saying that I don't want to touch any of the module's code.

So, one of the pages is the 'Bill To' address pane:

<div class="order-pane pos-left">
    <div class="order-pane-title">Bill to: </div>
    Name<br>
    Address<br>
    Town<br>
    Postcode<br>
</div>

Essentially I would like to put a class in the div, so that it looks like this:

<div class="order-pane pos-left bill-to">...</div>
<div class="order-pane pos-left ship-to">...</div>
<div class="order-pane pos-left payment">...</div>
<div class="order-pane pos-left comments">...</div>
...

I just cannot see a way of doing this.

Any help would be much appreciated.

+1  A: 

Have you checked the latest version of UC? The release note states:

The biggest change, though, is that order invoice templates now use the theme system to allow customizations. Instead of altering the module files directly, it is now correct to override them in the theme, just like node and page templates.

...and if I am not mistaken (a few months have passed by since I worked with UC), the invoice IS the page displayed by the URL you provided.

If my memory failed me (I haven't a UC installation handy to verify myself), a possible workaround (admittedly far from elegant, but still allowing you not to change the module's code) would be to alter the HTML with jQuery once the page has been loaded.

A more hack-ish workaround would be to maintain your own page callback for that URL, and just alter the menu definition in the UC code [yes, it's still hacking the code, but in this case you just need to modify one line in the UC code, and can maintain your code in a separate module].

HTH, Mac.

mac
Thanks, I had thought about jQuery, but we weren't very happy about that. I also thought creating a callback for each of the order panes, but I am not sure how we will be able to maintain that. I will look into this a bit further, I was kind of hoping I was just missing something.
JonB
+1  A: 

You can create youre own panes or a single pane for everything, look up hook_pane, or you can insert the classes using jquery.

Tom

related questions