how to theme the product node in grid view (in Drupal)

Posts: 6
Joined: 03/03/2008

Hi,

How can I theme the product node in grid view?

A similar question was posted here:
http://www.ubercart.org/forum/support/3160/correctly_themeing_ubercart

When I look at the code in uc_product.module it doesn't seem like there's anything there I can override other than theme functions for individual fields. That said, I'm not sure if any of it applies to grid view.

Ultimately what I want is to have a template like node-product.tpl.php where I can write HTML for the products. I uploaded a node-product.tpl.php file but it isn't affecting the output, so I assume I need to do something in my template.php file before node-product.tpl.php will work.

Thanks,
Ryan

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

The function you're looking for is theme_uc_catalog_product_grid(), which is in uc_catalog.module. It's the theme function for the entire grid, but you can change the way each node looks this way.

Posts: 6
Joined: 03/03/2008

hmmm. I had a look in uc_catalog.module. The only theme functions I see are...

theme_uc_catalog_block_start
theme_uc_catalog_block_end
theme_uc_catalog_browse
theme_uc_catalog_special_products
theme_uc_catalog_bestsellers_products
theme_uc_catalog_products
theme_uc_catalog_item

That's everthing that was turned up when I searched for "theme_"

I'm using 5.x-1.0-beta2

There's a slight chance someone else who worked on the project may have modified the file, but I think probably not.

-Ryan

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

We're up to beta6 now, so that would be why. There's lots of good stuff in the latest version, so I suggest you get it.

Posts: 10
Joined: 03/04/2008

Well, upgrading sounds like a great idea, will it solve all of my problems?
Additionally, I am using beta-7 and I cannot find the function you listed.
I'm getting some silly results and am hoping for some theme help.

Posts: 2008
Joined: 08/07/2007
AdministratoreLiTe!

All I can tell you is look again. If it's really not there, it might be another silly result. In that case you should download it again.

Posts: 14
Joined: 08/19/2008

If I wanted to change how (for instance) the "theme_uc_catalog_product_grid" displayed - do I need to edit the html content in uc_catalog.module? (This seems risky.)

Do I create another file in my themes folder or is this a node overwrite?

What would my basic step 1-3 be before I can actually change the display? (Make sense?)

Oh, duh ... should have read the post above: http://www.ubercart.org/forum/support/3160/correctly_themeing_ubercart !