13 replies [Last post]
Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 316
Was this information Helpful?

Hi there,

Is there an option to change "Review order" Button text in check out page?

Regards,
AnAnD

droddis's picture
Offline
Joined: 10/07/2009
Juice: 24
Button Text

I'm interested in the same thing as I'm using Ubercart as a quoting tool for the intial roll-out of the site. I've found how to change the majority of the text surround the boxes, comment text etc by editing the PHP files but I can't seem to find the button text.

I'm assuming this is a call function based on some other non-editable title variable?

Any help would be appreciated.

shanesj's picture
Offline
Joined: 11/03/2009
Juice: 19
Re: Button Text

I would also like suggestions on how to make this happen.

Shane

Sell your car faster!
ForSaleWithWarranty.com

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15450
Re: Re: Button Text

You have to use hook_form_alter() in a custom module to make this happen. Specifically, something like the following implementation should work fine:

<?php
function example_form_uc_cart_checkout_form_alter(&$form, &$form_state) {
 
$form['continue']['#value'] = t('Whatever you want it to say');
}
?>
shanesj's picture
Offline
Joined: 11/03/2009
Juice: 19
Re: Re: Re: Button Text

Thanks for your help, Ryan. It is greatly appreciated (especially by noob's like me Smiling )

Shane

Sell your car faster!
ForSaleWithWarranty.com

Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 316
Re: Re: Re: Button Text

Hi, Ryan thanks for the suggestion... Smiling

moby's picture
Offline
Joined: 10/05/2008
Juice: 188
change button color?

is it the same route to change the checkout button color?

Ideally, I want to turn it green once there is products in the cart.

vanecgs's picture
Offline
Joined: 06/09/2010
Juice: 4
Re: Re: Button Text

When doing this in function phptemplate_uc_cart_checkout_form($form) it changes the behavior of the checkout form and does not proceed to the review section, unless I (in my case) deactivate the shipping module, it didn't returned any message errors or sign that let me now what was going wrong.

DrunkMunki's picture
Offline
Joined: 12/09/2010
Juice: 29
Re: Re: Re: Button Text

I tried your code to change the Back button text to 'Edit' on the reivew page and it gives me a white screen.
I tried with function example_form_uc_cart_checkout_review_form_alter aswell with same results.

any idea how i can simply change the text in UC2.4 (drupal 6.20)?

i get the error message:
Cannot modify header information - headers already sent by (output started at /home/user/public_html/themes/customtemplate/template.php:1) in /home/user/public_html/includes/common.inc on line 148.

creativ180's picture
Offline
Joined: 05/19/2011
Juice: 5
Re: Re: Re: Re: Button Text

It looks like you tried to put the function in your template.php file. I used the function in a custom module and it worked great for the Review Order button. Check out this page on Drupal.org for help on building a custom module: http://drupal.org/node/416986

Also, check the name of the button. It looks like the button name is edit-back. The code might look like this:

<?php
function example_form_uc_cart_checkout_review_form_alter(&$form, &$form_state) {
  
$form['edit-back']['#value'] = t('Whatever you want it to say');
}
?>

This is just a guess. I didn't test the actual code.

DrunkMunki's picture
Offline
Joined: 12/09/2010
Juice: 29
String Overrides.

thanx for the info, i ended up using the String Overrides Module, although its a blanket solution, it will do until i figure out how to specifically target just this text.

bhold29's picture
Offline
Joined: 07/15/2011
Juice: 5
CSS SOLVES THIS

I have had the same issue and got round it by using an image for the button using CSS.

Have tested it on various browsers and all works fine.

A lot easier than hacking code!

JmsCrk's picture
Offline
Joined: 10/08/2010
Juice: 20
Working in Drupal 7 with Ubercart 3

Just a note to anyone coming across this who want to change the 'review order' label in Drupal 7 with Ubercart 3.

I found that the below code in a custom module enabled me to change the label. For some reason changing $form['continue']['#value'] didn't actually change the displayed value. But $form['actions']['continue']['#value'] did.

<?php
/**
* Implements form_uc_cart_checkout_form_alter().
* Renames checkout button
*/

function MYMODULENAME_form_uc_cart_checkout_form_alter(&$form, &$form_state, $form_id) {
 
$form['continue']['#value'] = t('Continue Checkout');
 
$form['actions']['continue']['#value'] = t('Continue Checkout');
}
?>
JensJensen's picture
Offline
Joined: 12/05/2012
Juice: 19
Re: Change Review Order button text

Can you tell me where exactly I have to paste this code?
I also want to change the text of the "Review order" Button.