Correctly Themeing Ubercart

Posts: 3
Joined: 02/11/2008

I'm relatively new to Drupal and Ubercart and have a question about theming.

I have created a store using Ubercart and have themed it. However, I think that I went about theming it the wrong way and was hoping you could provide me with some links/info that can help. Currently, all my theming was done inside the Ubercart module rather than in my them. For example, if when I wanted to theme the cart block I went into uc_cart.module and changed the:
function theme_uc_cart_block_content(...)
{
...
}

Is there a way I can do this from within my theme rather than having to change the .module code. As you can imagine it's now somewhat painful for me to update the Ubercart modules because I might lose my theme changes.

Thanks for the help!

Posts: 797
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

You have just learned why this is the "wrong" way to do it Smiling

To put the function override into your theme, copy the "theme_" function into template.php (Found in your theme directory. If it's not there just create it - some themes don't have a version of this file). Edit template.php and change the "theme_" in the function name to be "yourthemename_", where "yourthemename" is the actual name of your theme, or you can use "phptemplate_" instead. Then modify the code in the function to emit the HTML you want.

--

<tr>.

Posts: 3
Joined: 02/11/2008

Awesome, thanks for the info. I knew there had to be a better way Smiling

Thanks!