Last active
February 13, 2017 21:43
-
-
Save fastdivision/0ae7be19aa25155f74cc7c06a38b64ae to your computer and use it in GitHub Desktop.
Magento + TaxJar Custom Product Taxability Exceptions by State
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Include around here: | |
// https://github.com/taxjar/taxjar-magento-extension/blob/master/app/code/community/Taxjar/SalesTax/Model/Smartcalcs.php#L236 | |
// Taxable in one state, exempt in other exempt states | |
$specialTaxableProducts = array(1001, 1002, 1003, 1004); // Product IDs | |
// Tax these clothing products if shipped to PA | |
if (in_array($item->getProductId(), $specialTaxableProducts) && $address->getRegionCode() == 'PA') { | |
$taxCode = ''; // Fully taxable | |
} | |
// Taxable in multiple states, exempt in other exempt states | |
$specialTaxableProducts = array(1001, 1002, 1003, 1004); // Product IDs | |
$specialTaxableStates = array('MN', 'PA'); | |
// Tax these Clothing products if shipped to MN or PA | |
if (in_array($item->getProductId(), $specialTaxableProducts) && in_array($address->getRegionCode(), $specialTaxableStates)) { | |
$taxCode = ''; // Fully taxable | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment