You are here

function uc_usps_update_3 in Ubercart 6.2

Same name and namespace in other branches
  1. 5 shipping/uc_usps/uc_usps.install \uc_usps_update_3()

File

shipping/uc_usps/uc_usps.install, line 136
Install hooks for uc_usps.module.

Code

function uc_usps_update_3() {
  $ret = array();
  $markup = variable_get('uc_usps_markup', '0%');
  if (strpos($markup, '%') !== FALSE) {
    variable_set('uc_usps_markup_type', 'percentage');
    variable_set('uc_usps_markup', floatval(rtrim($markup, '%')));
  }
  elseif (strpos($markup, '$') !== FALSE) {
    variable_set('uc_usps_markup_type', 'currency');
    variable_set('uc_usps_markup', floatval(ltrim($markup, '$')));
  }
  elseif (floatval($markup)) {
    variable_set('uc_usps_markup_type', 'multiplier');
    variable_set('uc_usps_markup', floatval($markup));
  }
  $ret[] = array(
    'success' => TRUE,
    'query' => 'Added USPS markup type.',
  );
  return $ret;
}