12 replies [Last post]
sarahara's picture
Offline
Joined: 01/22/2009
Juice: 33
Was this information Helpful?

Hello There,

i'm currently trying to theme the checkout form but i can't do it. The system does not accept my customization and i don't know why.

I'm trying to do it like this:

function theme_uc_cart_checkout_form($form) {

$output .= 'test test';

  }

but the full checkout page does appear. What am i doing wrong? Normaly there should only appear a "test test" on the page?

Mmmmh. And i think my further costumization will be the same like this.

Do i have a fundamental problem of understanding??

Thanks

Sarah

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Hi Sarah, First, here's a

Hi Sarah,

First, here's a Book page on the subject - try to read that and see if anything there makes sense: http://drupal.org/node/55126

Secondly, where are you putting this override function? It's best to put it in your theme's template.php file, and instead of calling it theme_uc_cart_checkout_form($form) you should rename it to use either your theme engine, or the name of your theme, i.e. phptemplate_uc_cart_checkout_form($form). This way the theme engine knows to use that function instead of the original theme function (and it'll also prevent you from having a Fatal error of the "cannot redeclare function" type, causing a White Screen of Death).

If you're using Drupal 6 then you'll need to clear the Theme Cache, which is done at admin > settings > performance.

--
Help directly fund development: Donate via PayPal!

sarahara's picture
Offline
Joined: 01/22/2009
Juice: 33
thanks torgo! now that i try

thanks torgo!

now that i try

function phptemplate_uc_cart_checkout_form($form) {

$output .= 'test test';

  }

it also doesn't work. i get the full checkout form page with all the billing information fields and stuff like that. why? does anybody have a working code or hint for customizing this page? or better, the whole checkout with cart view and stuff?

thanks

sarah

sarahara's picture
Offline
Joined: 01/22/2009
Juice: 33
Re: thanks torgo! now that i try

does someone have an answer for my issue? there must be a way to do that, but i can't find it.

would be so nice, if there were a solution

sarah

sarahara's picture
Offline
Joined: 01/22/2009
Juice: 33
Still not solved

Does anyone have an idea, how i could do that? Why is there no solution?

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Still not solved

Where are you adding that PHP code? Which file? If you want to hop on IRC in #drupal-ubercart (freenode) I can help out there.

--
Help directly fund development: Donate via PayPal!

sarahara's picture
Offline
Joined: 01/22/2009
Juice: 33
Re: Can't override theme functions?

i put this into the template.php
is this the wrong place?

sorry, i don't have irc and never had it Sad

sarah

adrianmak's picture
Offline
Joined: 05/28/2008
Juice: 312
Re: Re: Can't override theme functions?

I have tested on my uc site, it works without any problem.

I think you may check any typing mistake carefully

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Can't override theme functions?

Two things, I'd also make sure that you're doing it in the right template.php file. I know with Zen at least, one file gets called while the other does not, depending of course if you're using a Zen subtheme, etc.

Also with Drupal 6, whenever you add a new template function, you need to rebuild the Theme cache.

--
Help directly fund development: Donate via PayPal!

sarahara's picture
Offline
Joined: 01/22/2009
Juice: 33
okay, my template.php is

okay,

my template.php is located in sites/all/themes/newsflash (i customized the newsflash theme). and ubercart doesnt use another theme, right? so i put this into my newsflash template.php.

this is what i insert :

function phptemplate_uc_cart_checkout_form($form) {

$output .= 'test test';

  }

i think there is no typing mistake. what i also did is, that i put this into the zen template.php and switched the template to zen. also it didn't work.

@adrianmak: could you tell me, what exactly you insert in you template.php?

this is so crazy.

harrisben's picture
Offline
Joined: 04/17/2009
Juice: 192
Re: okay, my template.php is

This sounds a lot like something I've experienced previously, until I learned to clear the theme registry/cache. The latest build of the Administration Menu module (http://drupal.org/project/admin_menu) makes it easy to clear any and/or all caches when needed and adding code to your template.php definitely falls under that category, as does setting up specific .tpl.php files for your theme.

sarahara's picture
Offline
Joined: 01/22/2009
Juice: 33
i am using drupal 5 and i

i am using drupal 5

and i can't find any "theme cache clear" button or link. i only have a clear cache link and some performance things to edit under "site configuration". but there is also no "empty cache" link.

thanks so much for your help, i hope that there's a solution soon. this is driving me so nuts

sarahara's picture
Offline
Joined: 01/22/2009
Juice: 33
Re: Can't override theme functions?

i did it, i tried another way and it worked
thanks for all your support
good to know, that there are people who help