You are here

function uc_store_price_handler_alter in Ubercart 6.2

Default price handler alterer; adds the default prefixes to the various product prices when viewing a product node.

1 string reference to 'uc_store_price_handler_alter'
uc_store_uc_price_handler in uc_store/includes/uc_price.inc
Implements hook_uc_price_handler().

File

uc_store/includes/uc_price.inc, line 264
Price handling functions and hooks.

Code

function uc_store_price_handler_alter(&$price, &$context, &$options) {

  // If a class was specified in the price's context array...
  if (isset($context['class']) && is_array($context['class'])) {

    // Look for a product price type in the class array and adjust the price
    // prefix accordingly.
    if (in_array('list', $context['class'])) {
      $options['prefixes'][] = t('List Price: ');
    }
    elseif (in_array('cost', $context['class'])) {
      $options['prefixes'][] = t('Cost: ');
    }
    elseif (in_array('sell', $context['class'])) {
      $options['prefixes'][] = t('Price: ');
    }
  }
}