Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8990465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:30:21+00:00 2026-06-15T22:30:21+00:00

I am trying to hook into uc_addresses submit function, but it has become very

  • 0

I am trying to hook into uc_addresses submit function, but it has become very confusing very fast. Just to note this is Ubercart running on Drupal 6. So I’ve isolated the code in uc_addresses.module that I’m interested in hooking in to:

function uc_addresses_get_address_form_submit($form, &$form_state) {
  global $user;

  $address_user = $form['stored_values']['#value']['user'];
  $address = $form['stored_values']['#value']['address'];
  $view = $form['stored_values']['#value']['view'];

  if ($form_state['clicked_button']['#value'] == t('Delete address')) {
      cache_clear_all();
      $form_state['redirect'] =
    array('user/'. $address_user->uid .'/addresses/' . $address->aid . '/delete');
  }
  else {
    if (!$address) {
      $address = new stdClass();
      $address->uid = $address_user->uid;
    }

    $valid = TRUE;
    foreach (element_children($form_state['values']['panes']) as $pane_id) {
      $func = _address_pane_data($pane_id, 'callback');
      $isvalid = $func('process', $address, $form_state['values']['panes'][$pane_id]);
      if ($isvalid === FALSE) {
    $_SESSION['expanded_panes'][] = $key;
    $valid = FALSE;
      }
    }
    if ($view == 'edit') { // Update database
      _uc_addresses_db_update_address($address);
    }
    elseif ($view == 'new' || $view == 'add') { // Insert into datebase
      _uc_addresses_db_add_address($address);
    }
    $form_state['redirect'] = array('user/'. $address_user->uid .'/addresses');
  }
}

The goal is to copy a portion of the submitted form values in the database. Which in itself may be an issue because I need to make sure my hook occurs after the values have been written to the table. So my question is what should my hook function look like if I want it to occur after this form has been submitted?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:30:22+00:00Added an answer on June 15, 2026 at 10:30 pm

    Okay so foolish me didn’t realize that there is a huge section in the uc_addresses documention about hooks. Link to the documentation. In this specific case where you want to hook into form submissions I would recommend using hook_uc_addresses_address_insert() and hook_uc_addresses_address_update().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to hook into the OnSysCommand function but I'm getting a confusing error.
This is how I'm trying to hook into the mobileinit event: $(document).bind(mobileinit, function() {
Trying to hook into the function comment_text() supplied by Wordpress API to wrap the
I am trying to hook into a link in a gridview with jquery but
I'm trying to hook into Google Analytics and have this: @using (Html.BeginForm(Register, Account, FormMethod.Post,
I'm trying to hook into a function that loads Facebook's news feed: UIIntentionalStream.instance &&
I'm trying to hook the SetCooperativeLevel function in the DirectDraw object. My goal is
What I am trying to do is use the Detours library to hook into
I want to put some sort of hook into windows (only has to work
I'm trying to hook PageDown into my Rails app, because the Markdown editor is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.