smplejohn Posted March 8, 2010 Share Posted March 8, 2010 I've set everything up correctly to charge tax only to residents of Texas. That part works, but the products I have set up to not charge taxes are still charging them in the state of Texas... any ideas?$20 to the PayPal account who gets the right answer first. Just rolled the site live today.Update:I've figured out that it's either all or nothing with State Tax and Product Tax is where the individual rules get applied per product. Now, what I need is to use Product Tax, but exclude any taxes being charged outside of Texas.What I'm thinking is in classes\Tax.php editing:if ($tax_behavior == PS_STATE_TAX) return Tax::getRateByState(intval($address_ids['id_state'])); to read something like: if ($tax_behavior == PS_STATE_TAX AND STATE !== 'Tx') return Tax::getRateByState(intval($address_ids['id_state'])); Obviously this is nowhere near right, but these are just my thoughts. Link to comment Share on other sites More sharing options...
smplejohn Posted March 8, 2010 Author Share Posted March 8, 2010 Maybe these screen shots will help explain what the issue is... Link to comment Share on other sites More sharing options...
rocky Posted March 9, 2010 Share Posted March 9, 2010 What do you have the tax behavior set to for the "Texas" state? Do you have it set on "Product tax", "State tax", or "Both product & state tax"? Link to comment Share on other sites More sharing options...
smplejohn Posted March 9, 2010 Author Share Posted March 9, 2010 State Tax, if you have any insight I'd greatly appreciate it. This is the only thing keeping the site from going live. Link to comment Share on other sites More sharing options...
rylersbud Posted March 9, 2010 Share Posted March 9, 2010 I am having simular troubles I have a sales tax for texas that does not show up I have set the products to no tax and it doesnt show up if I set the products to sales tax but apply this tax for only texas the tax is added for everyone.mechanictoolsonline.com/index.php Link to comment Share on other sites More sharing options...
smplejohn Posted March 12, 2010 Author Share Posted March 12, 2010 Alright, so I've done a fresh install on my local box and used all the default settings with the exception of local taxes and it works fine. So, I know it's an edit I've done to the cart. Any direction a moderator can point me in as far as the file that messed up tax? Link to comment Share on other sites More sharing options...
smplejohn Posted March 15, 2010 Author Share Posted March 15, 2010 I think I've finally got a grasp on how tax works and know the issue. Normally this is the process:State Tax Selected > User lives in state > All products taxedI need:State tax selected > User lives in state > Tax given to individual product > Product is taxedorState tax selected > User lives in state > No Tax selected for product > Product not taxedPlease, any thoughts? Link to comment Share on other sites More sharing options...
smplejohn Posted March 15, 2010 Author Share Posted March 15, 2010 I'm guessing this is the code I'll need to edit: static public function getApplicableTax($id_tax, $productTax) { global $cart, $cookie, $defaultCountry; $id_address_invoice = intval((Validate::isLoadedObject($cart) AND $cart->id_address_invoice) ? $cart->id_address_invoice : (isset($cookie->id_address_invoice) ? $cookie->id_address_invoice : 0)); /* If customer has an address (implies that he is registered and logged) */ if ($id_address_invoice AND $address_ids = Address::getCountryAndState($id_address_invoice)) { $id_zone_country = Country::getIdZone(intval($address_ids['id_country'])); /* If customer's invoice address is inside a state */ if ($address_ids['id_state']) { $state = new State(intval($address_ids['id_state'])); if (!Validate::isLoadedObject($state)) die(Tools::displayError()); /* Return tax value depending to the tax behavior */ $tax_behavior = intval($state->tax_behavior); if ($tax_behavior == PS_PRODUCT_TAX) return $productTax * Tax::zoneHasTax(intval($id_tax), intval($id_zone_country)); if ($tax_behavior == PS_STATE_TAX) return Tax::getRateByState(intval($address_ids['id_state'])); if ($tax_behavior == PS_BOTH_TAX) return ($productTax * Tax::zoneHasTax(intval($id_tax), intval($id_zone_country))) + Tax::getRateByState(intval($address_ids['id_state'])); /* Unknown behavior */ die(Tools::displayError('Unknown tax behavior!')); } /* Else getting country zone tax */ if (!$id_zone = Address::getZoneById($id_address_invoice)) die(Tools::displayError()); return $productTax * Tax::zoneHasTax(intval($id_tax), intval($id_zone)); } /* Default tax application */ if (!Validate::isLoadedObject($defaultCountry)) die(Tools::displayError()); return $productTax * Tax::zoneHasTax(intval($id_tax), intval($defaultCountry->id_zone)); } Any ideas on what to do? I'm going to plug away at it, see if I come up with anything. I'm not too familiar with this though. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now