You are here

function hook_uc_price_handler in Ubercart 6.2

Defines price handlers for your module.

You may define one price alterer and one price formatter. You may also define options that are merged into the options array in order of each price alterer's weight.

1 function implements hook_uc_price_handler()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

uc_store_uc_price_handler in uc_store/includes/uc_price.inc
Implements hook_uc_price_handler().
1 invocation of hook_uc_price_handler()
_uc_price_get_handlers in uc_store/includes/uc_price.inc
Return an array of price handler data.

File

docs/hooks.php, line 1679
These are the hooks that are invoked by the Ubercart core.

Code

function hook_uc_price_handler() {
  return array(
    'alter' => array(
      'title' => t('My price handler'),
      'description' => t('Handles my price alteration needs.'),
      'callback' => 'my_price_handler_alter',
    ),
    'format' => array(
      'title' => t('My price handler'),
      'description' => t('Handles my price formatting needs.'),
      'callback' => 'my_price_handler_format',
    ),
    'options' => array(
      'sign' => variable_get('uc_currency_sign', '*'),
      'sign_after' => TRUE,
      'prec' => 4,
      'dec' => ',',
      'thou' => '.',
      'label' => FALSE,
      'my_option_that_my_formatter_recognizes' => 1337,
    ),
  );
}