i've been trying to theme this by copying the function to my template.php and renaming it accordingly. i've cleared the cache and even removed the code from the module itself and nothing seems to change.
anything i'm missing here...?

Comments

Rob T’s picture

I'm was in the same boat.

I couldn't seem to override theme_uc_catalog_product_grid in template.php (with either my theme name or "phptemplate" replacing the "theme" part of the function name.

Earlier in the day, I had installed a contributed module - Price Quotes (uc_quotes). I figured I'd turn it off and see if it had any affect, and sure enough, it did. If you are not using the Price Quotes module, perhaps there is another contributed module that is interfering.

I perused through uc_quote's module code. There were a handful of calls to theme and theme registry of uc_catalog_product_grid in there. So in my case, I'm pretty sure uc_quotes was screwing up my attempt to override theme_uc_catalog_product_grid in template.php.

epop’s picture

bump

superkt’s picture

Ahhh.
Did you get it working with uc_quotes as well?
I'm using that module as well and it's pretty necessary on this site. I assume you could change the calls in uc_quotes to phptheme_uc_catalog_product_grid in the template.php? I'm still fairly new with really themeing Drupal myself but its sounds like it may work.

superkt’s picture

Meh. I ended up editing the uc_quotes.module. Probably not the best solution but it's working. Thanks for the hint!

tr’s picture

Status: Active » Closed (fixed)

Overriding a theme function is a standard Drupal technique that works for theme_uc_catalog_product_grid() exactly like it works for any other theme function in Drupal. Hacking core (or in this case uc_quotes.module) is the wrong way to do it, and is a poor substitute for figuring out the right way. There's lots of information on this site about how to override theme functions, and almost every book on Drupal goes into this subject as well.

alexloganlee’s picture

I tried replacing both theme_uc_catalog_product_grid($products) and theme_uc_quotes_product_grid($products) in template.php but nothing works.