10 replies [Last post]
yupioegg's picture
Offline
Joined: 03/03/2008
Juice: 22
Was this information Helpful?

How can I change the following text in checkout pane>?

"Enter a valid email address for this order or click here to login with an existing account and return to checkout."

I tried something like this (and other variation of ) --but didn't work..

function my_module_form_alter($form_id, &$form){
  if ($form_id == 'uc-cart-checkout-form'){
      $form['customer-pane']['description'] =    
      t('Additional Information');
    
  }

}

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: How to change description of checkout pane?

Is this not an option at admin/store/settings/checkout/edit/messages? If not, it sounds like something that should be there, perhaps...

--
Help directly fund development: Donate via PayPal!

yupioegg's picture
Offline
Joined: 03/03/2008
Juice: 22
Re: Re: How to change description of checkout pane?

Thank you for your fast reply!

Unfortunaltey, I did not see option at admin/store/settings/checkout/edit/messages.

When I looked at uc_cart_checkout_pane.inc, the text seemed to be hard coded.

$description = t('Enter a valid email address for this order or <a href="!url">click here</a> to login with an existing account and return to checkout.', array('!url' => url('user/login')));

If you happened to know how form_alter can be used, or if there is any recommendation, I really appreciate it. (As I do not want to modify the core)

Thank you again!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: How to change description of checkout pane?

It looks correct, except I think it should be ['#description'] and not ['description']. Everything else looks fine, though.

--
Help directly fund development: Donate via PayPal!

yupioegg's picture
Offline
Joined: 03/03/2008
Juice: 22
Re: Re: Re: Re: How to change description of checkout pane?

Thank you for reviewing the code. I still could not make it work with "['#description']"

--
I must be missing something.... Sad

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: Re: Re: Re: How to change description of checkout pane?

The form_id should be uc_cart_checkout_form

I gave a complete example here: http://www.ubercart.org/comment/8749/Re-Removing-SKU-product-edit-page

<tr>.
yupioegg's picture
Offline
Joined: 03/03/2008
Juice: 22
Thank you very much. I

Thank you very much.

I finally figured out with all your help.

I was looking at the page source before (in browser)- but I learned that ID in source code is not always the code that form_alter usese ... This module gave me the final key to resolve this: http://drupal.org/project/forminspect

Here is the code that worked for me to change the description:

function my_module_form_alter($form_id, &$form){
  if ($form_id == 'uc_cart_checkout_form'){
 
       $form['panes']['customer']['#description']= 'Additional Information';
     
    );
  }

}

macman's picture
Offline
Joined: 09/20/2010
Juice: 12
module not changing customer info

Hi

I have created a module as follows that is basically a copy of the one above to try to modify the customer info.

I can see that the module is being loaded because, if I put in incorrect syntax, I get a parse error. However, it makes no changes to the actual text on the cart/checkout page. Please help.

uc_alter_custinfo.info

; $Id$
name = uc_alter_custinfo
description = Modifies the customer info description in the checkout
package = Custom
core = 6.x

uc_alter_custinfo.module

// $Id$

/**
* @file
* Modifies the customer info description in the checkout
*/

/**
* Implementation of hook_form_alter()
*/
function uc_alter_custinfo_form_alter($form_id, &$form){
  if ($form_id == 'uc_cart_checkout_form'){

       $form['panes']['customer']['#description']= 'My changed text';
    
    };
  }

yesct@drupal.org's picture
Offline
Uber Donor
Joined: 11/18/2008
Juice: 294
update? in latest version

was this message added to the configuration options? Thanks!

echo's picture
Offline
Joined: 08/05/2009
Juice: 31
Re: How to change description of checkout pane?

I know this is an old thread, but wanted to add that we can use String Overrides http://drupal.org/project/stringoverrides to do this, a handy module I really like. Another important point is this should certainly be a configurable string in admin/store/settings/checkout/edit/messages - for the anonymous setup where we never have the end user login. I've added this to the issue tracker.

creativ180's picture
Offline
Joined: 05/19/2011
Juice: 5
for Drupal 6.x

This thread is old, but for those of you who may be looking for the same thing and are having trouble, the api for hook_form_alter has changed in 6.x. The function signature is

<?php
function my_module_form_alter(&$form, &$form_state, $form_id)
{
 
//function code
}
?>

Otherwise, the code in #6 works.