k,
I think the problem was that I'm testing slightly differently to you, in that I was changing the primary address via the My Account section. This was masking the fact that the logic to choose the tax descriptions was only relying on the primary address, so changes made to the tax address (either by adding a new address or selecting a non primary address, would not be recognised)
So with fingers crossed, can you try this
PHP Code:
function process() {
global $order, $currencies;
reset($order->info['tax_groups']);
$taxDescription = '';
$taxValue = 0;
if (STORE_TAX_DISPLAY_STATUS == 1)
{
$taxAddress = zen_get_tax_locations();
$result = zen_get_all_tax_descriptions($taxAddress['country_id'], $taxAddress['zone_id']);
if (count($result) > 0)
{
foreach ($result as $description)
{
if (!isset($order->info['tax_groups'][$description]))
{
$order->info['tax_groups'][$description] = 0;
}
}
}
}
if (count($order->info['tax_groups']) > 1 && isset($order->info['tax_groups'][0])) unset($order->info['tax_groups'][0]);
while (list($key, $value) = each($order->info['tax_groups'])) {
if (SHOW_SPLIT_TAX_CHECKOUT == 'true')
{
if ($value > 0 or ($value == 0 && STORE_TAX_DISPLAY_STATUS == 1 )) {
$this->output[] = array('title' => ((is_numeric($key) && $key == 0) ? TEXT_UNKNOWN_TAX_RATE : $key) . ':',
'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
'value' => $value);
}
} else
{
if ($value > 0 || ($value == 0 && STORE_TAX_DISPLAY_STATUS == 1))
{
$taxDescription .= ((is_numeric($key) && $key == 0) ? TEXT_UNKNOWN_TAX_RATE : $key) . ' + ';
$taxValue += $value;
}
}
}
if (SHOW_SPLIT_TAX_CHECKOUT != 'true' && ($taxValue > 0 or STORE_TAX_DISPLAY_STATUS == 1))
{
$this->output[] = array(
'title' => substr($taxDescription, 0 , strlen($taxDescription)-3) . ':' ,
'text' => $currencies->format($taxValue, true, $order->info['currency'], $order->info['currency_value']) ,
'value' => $taxValue);
}
}
Bookmarks