function hook_commerce_addressbook_callback_alter in Commerce Addressbook 7.2
Allows modules to alter the AJAX commands when selecting another customer profile.
During checkout the user selects the "address on file" from a dropdown list of customer profiles. The response (prefilled fields) is handled using AJAX. By altering the array of AJAX commands, a module can add additional commands to the response.
Parameters
array $commands: An array of AJAX commands.
type $form: Nested array of form elements that comprise the form.
type $form_state: A keyed array containing the current state of the form.
1 invocation of hook_commerce_addressbook_callback_alter()
- commerce_addressbook_checkout_form_callback in ./
commerce_addressbook.module - Ajax callback for replacing the appropriate commerce customer checkout pane.
File
- ./
commerce_addressbook.api.php, line 44 - This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.
Code
function hook_commerce_addressbook_callback_alter(&$commands, $form, $form_state) {
// Example.
$commands[] = ajax_command_alert('It works!');
}