At the moment UC2 supports the addition of columns to the product table via hook_tapir_table_alter(). Unfortunately, it's not possible to sort those additional columns because the code building the ORDER query clause have no way of finding out these new columns. Talking with Ryan we came up with the plan to add a new hook, hook_tapir_table_header_alter(), that is to be called before the query is built.

I'll write the patch on Monday.

Comments

rszrama’s picture

Subscribin', yo.

sammys’s picture

Status: Active » Needs review
StatusFileSize
new2.75 KB

Patch attached. Also memory cached the product table header so it doesn't need to be altered twice when the catalog is built.

Island Usurper’s picture

Status: Needs review » Needs work

Patch doesn't apply anymore, though it's easy enough to figure out by hand. Update to DRUPAL-6--2.

However, I'd also like to see an example implementation added to docs/hooks.php. It doesn't have to be completely fleshed out, just enough to give people an idea of what they have to work with.

sammys’s picture

*DELETED*

sammys’s picture

Status: Needs work » Needs review
StatusFileSize
new2.79 KB

Here is an updated patch to apply to 6.x-2.x. I'll add the example during the week.

rszrama’s picture

Issue tags: +ubercamp sprint
sammys’s picture

StatusFileSize
new5.6 KB

Here's a patch with hook docs for both hook_tapir_table_alter() and hook_tapir_table_header_alter() complete with example code.

Island Usurper’s picture

Status: Needs review » Fixed

Thanks a bunch, Sammy.

Committed with a small change to the hooks' documentation. The api.module parser expects a one-line summary in its own paragraph at the top of the comment. I just rearranged some words to make the first sentence fit in one line.

Status: Fixed » Closed (fixed)
Issue tags: -ubercamp sprint

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