commerce_avatax.install in Drupal Commerce Connector for AvaTax 7.3
File
commerce_avatax.install
View source
<?php
function commerce_avatax_requirements($phase) {
$requirements = array();
$t = get_t();
$has_soap = extension_loaded('soap');
$requirements['commerce_avatax_soap'] = array(
'title' => $t('SOAP'),
'value' => $has_soap ? $t('Enabled for AvaTax Calc') : $t('Not found'),
);
if (!$has_soap) {
$requirements['commerce_avatax_soap']['severity'] = REQUIREMENT_ERROR;
$requirements['commerce_avatax_soap']['description'] = $t('AvaTax requires SOAP to be configured on your server.');
}
return $requirements;
}
function commerce_avatax_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'commerce_avatax_%'");
cache_clear_all('variables', 'cache');
$rules = rules_config_load_multiple(FALSE);
foreach ($rules as $rule) {
if (strpos($rule->name, 'commerce_avatax') === 0) {
rules_config_delete(array(
$rule->id,
));
}
}
}