Skip to content

Commit

Permalink
No tax should apply Tax basis = Store & store zone has no tax set
Browse files Browse the repository at this point in the history
fixes issue zencart#6384
  • Loading branch information
piloujp committed Jun 24, 2024
1 parent ddbd77b commit 79d402b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion includes/classes/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ function determineTaxAddressZones($billToAddressId, $shipToAddressId)
if (isset($this->billing['zone_id']) && $this->billing['zone_id'] == STORE_ZONE) {
$address_book_id = $billToAddressId;
} else {
$address_book_id = ($this->content_type === 'virtual' ? $billToAddressId : $shipToAddressId);
$address_book_id = ($this->content_type === 'virtual' ? $billToAddressId : -1);
}
}
$tax_address_query = "SELECT ab.entry_country_id, ab.entry_zone_id
Expand Down
16 changes: 9 additions & 7 deletions includes/functions/functions_taxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,15 @@ function zen_get_multiple_tax_rates($class_id, $country_id = -1, $zone_id = -1,
$rates_array = [];

if ($country_id == -1 && $zone_id == -1) {
if (zen_is_logged_in()) {
$country_id = $_SESSION['customer_country_id'];
$zone_id = $_SESSION['customer_zone_id'];
} else {
$country_id = STORE_COUNTRY;
$zone_id = STORE_ZONE;
}
if (STORE_PRODUCT_TAX_BASIS != 'Store') {
if (zen_is_logged_in()) {
$country_id = $_SESSION['customer_country_id'];
$zone_id = $_SESSION['customer_zone_id'];
} else {
$country_id = STORE_COUNTRY;
$zone_id = STORE_ZONE;
}
}
}

$tax_query = "SELECT tax_description, tax_rate, tax_priority
Expand Down

0 comments on commit 79d402b

Please sign in to comment.