Handling (by GeoZone) supported?
Posted: Wed Jan 27, 2010 3:21 am
Looking at the source code, it looks like the shipping address determines tax. However, the rules are not that simple (I wish they were). Our current store (which is awful, hence the switch to OpenCart) uses the following rule for determining if tax applies:
if ($billing_state != "AZ" && $shipping_state != "AZ") $tax = 0;
else $tax = ...;
If either the Billing or Shipping address is in the state, we can charge sales tax on taxable items because we handle the items. I suppose this is why it is called Shipping and "Handling". I don't make these rules up, I just make sure they get applied correctly.
I think the following modification will work, but I'd like someone to review who knows OpenCart better than me:
Becomes:
For guest checkout. I figure something similar will need to show up in account-based purchases.
if ($billing_state != "AZ" && $shipping_state != "AZ") $tax = 0;
else $tax = ...;
If either the Billing or Shipping address is in the state, we can charge sales tax on taxable items because we handle the items. I suppose this is why it is called Shipping and "Handling". I don't make these rules up, I just make sure they get applied correctly.
I think the following modification will work, but I'd like someone to review who knows OpenCart better than me:
Code: Select all
if ($this->cart->hasShipping()) {
$this->tax->setZone($this->request->post['country_id'], $this->request->post['zone_id']);
}
Code: Select all
if ($this->cart->hasShipping()) {
if ($this->request->post['country_id'] != $this->config->get('config_country_id') || $this->request->post['zone_id'] != $this->config->get('config_zone_id')) {
$this->tax->setZone($this->request->post['country_id'], $this->request->post['zone_id']);
} else {
$this->tax->setZone($this->config->get('config_country_id'), $this->config->get('config_zone_id'));
}
}