Adding Short Description to Product Grid Tutorial

Contrib type: 
Other
Status: 
Work in progress
Moderation: 
Awaiting moderation

Downloads

Compatibility: 
Ubercart 2.x

I put together a brief tutorial that summarizes what I learned about customizing the Product Grid in the forums. The idea is to present a step by step summary of this for anyone who is interested in doing this. I did it as a blog post at
Ubercart: Customizing the Default Product Grid


hwdornbush's picture
Offline
Joined: 04/28/2010
Juice: 14
Adding teaser to product grid

I needed to format the Ubercart catalog differently from how it is in the default distribution. Specifically, I wanted to include the product description teaser in the catalog listings. I found two possibilities:

I found this blog post that described how to add a field for a short description. That was a start.

I found a patch posted on Ubercart: http://www.ubercart.org/contrib/10983 to add a teaser to the catalog. It would probably have worked, but it required a patch to Ubercart.

In looking through the patch and the blog entry, it occurred to me that I might be able to combine these approaches. I followed step 3 of the blog and created an override in the template.php file for the theme_uc_catalog_product_grid function. Then I added a different line of code, guessing that the Ubercart people would have included access to the product's teaser in their $product array. the line I added was:

$product_table .= ''. $product->teaser .'';

just after:

$product_table .= ''. $imagelink .'';

And voila, I had the product's description teaser in my catalog entry! Now I had to do some additional work in my style.css file to change how the catalog entry was styled, and some more tweaks to template.php to change the content a little of a product display, and I had my teaser as part of the catalog entries.

Bill Dornbush
www.dornbush.net