By default ups.inc set this variable to 'LBS', but in Spain, UPS doesn't allow to use this measurement unit, so you must change it.

In order to use the UPS shipcalc in Spain I'm setting this variable:

<?php variable_set($shipcalc_unit, 'KGS'); ?>

You can add this script in a node with php format to execute the code once. Later you can erase the command fron the node.

I think it's a good idea to allow to set this variable in the ups configuration form "shipcalc_settings_form"

Comments

sime’s picture

Status: Active » Fixed

Could always be overridden in settings.php (see the default for examples.)
New admin page in EC5

solanas’s picture

I don't know how to override it with the settings.php. At the end of the file is explained but I think it's not working to me:

/**
 * Variable overrides:
 *
 * To override specific entries in the 'variable' table for this site,
 * set them here. You usually don't need to use this feature. This is
 * useful in a configuration file for a vhost or directory, rather than
 * the default settings.php. Any configuration setting from the 'variable'
 * table can be given a new value.
 *
 * Remove the leading hash signs to enable.
 */
# $conf = array(
#   'site_name' => 'My Drupal site',
#   'theme_default' => 'pushbutton',
#   'anonymous' => 'Visitor'
# );

  $conf = array('shipcalc_units' => 'KGStest');

If later I write a node with this code:

<?php 
echo variable_get($shipcalc_units, 'no initialiced');
?>

The node doesn't print 'KGStest', it continues printing 'KGS'.

Anonymous’s picture

Status: Fixed » Closed (fixed)