Closed (fixed)
Project:
Ubercart
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2009 at 21:33 UTC
Updated:
13 Oct 2011 at 09:22 UTC
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
Comment #1
Rob T commentedI'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.
Comment #2
epop commentedbump
Comment #3
superkt commentedAhhh.
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.
Comment #4
superkt commentedMeh. I ended up editing the uc_quotes.module. Probably not the best solution but it's working. Thanks for the hint!
Comment #5
tr commentedOverriding 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.
Comment #6
alexloganlee commentedI tried replacing both theme_uc_catalog_product_grid($products) and theme_uc_quotes_product_grid($products) in template.php but nothing works.