Ubercart is really good, but it does have a pretty major flaw that I would like to help address.
My problem is trying to change the way data it is presented. A lot of HTML is hard-coded without any theme hooks, and a lot of that uses outdated attributes like width, style, cellpadding, cellspacing, etc.
First, TAPIr is interesting, but limited. For instance, here is the HTML output for /products:
<table>
<thead>
<tr>
<th> ... </th>
...
</tr>
</thead>
<tbody>
<tr class="odd">
<td> ... </td>
...
</tr>
<tr class="even">
...As you can see there are no class attributes on any of the tags to distinguish this table from any other. Unfortunately, as far as I can tell, TAPIr does implement a few hooks to let you add columns to the table, but it does not let you add or change attributes at the table, head, row, cell, or footer level.
Second, a lot of HTML is hard-coded into non-theme functions, especially in the checkout where the tables don't even use TAPIr, for example here are lines 302-303 in uc_cart.module:
$output .= '<table style="border-bottom-width: 2px;" cellpadding="2">'
.'<tbody style="border-top: 0px;">';This is not an acceptable way to style anything in 2007. At the very least, these elements should be assigned classes, and all of the style information should be moved to a stylesheet. It would be even better, if this type of code was taken out of the existing function and moved to a theme function.
If you need an example, take a look at how menus are handled by the theming system. First, the entire data structure is passed to theme_menu_tree(), then each item is passed to theme_menu_item() and then each link is sent to theme_menu_item_link().
This may seem convoluted, but it is very powerful. At each point, you can override the default theme so that you can change from lists to divs, or tables, or spans, or XML, or whatever. More importantly, you can add, change or remove information in the data at each step. Ubercart needs this level of functionality, and I would be glad to give as much help as I can.


I feel like it was the first step in the right direction, but it's got several steps to go.


Joined: 08/22/2007