News:

Looking for documentation? Take a look on our wiki

Main Menu

[Fixed]tax_based_on_vendor_address dont work

Started by mauri, December 16, 2008, 22:03:17 PM

Previous topic - Next topic

mauri

Latest Night build VM 1.1.2 revision 1591
Dont know if this is 'host server(DB) setup' case.
Tax_based_on_vendor_address dont work, because if shopper have country with no state, in DB I have vm_tax_rate state = '-' , and in vm_user_info state = ' - '
and this dont match in file ps_product.php $q .= "AND tax_state='$state'";.

if (! ps_checkout::tax_based_on_vendor_address ()) {
if( $auth["user_id"] > 0 ) {
$q = "SELECT state, country FROM #__{vm}_user_info WHERE user_id='". $auth["user_id"] . "'";
$db->query($q);

$db->next_record();
$state = $db->f("state");
$country = $db->f("country");

$q = "SELECT tax_rate FROM #__{vm}_tax_rate WHERE tax_country='$country' ";
if( !empty($state)) {
$q .= "AND tax_state='$state'";
}
$db->query($q);

if ($db->next_record()) {
    $_SESSION['taxrate'][$ps_vendor_id] = $db->f("tax_rate");
}
else {
    $_SESSION['taxrate'][$ps_vendor_id] = 0;
}
}
else {
$_SESSION['taxrate'][$ps_vendor_id] = 0;
}
}

VirtueMart,(Joomla-phpShop, mambo-phpShop) since 2004-03-11

mauri

#1
FIXED in Virtuemart 1.1.3

$q .= "AND tax_state='$state'";
to:
$q .= "AND (tax_state='$state' OR tax_state=' $state ')";
VirtueMart,(Joomla-phpShop, mambo-phpShop) since 2004-03-11