Taxcloud:
Please, there is no reason to"jerry-rigg" a gift certificate or coupon for tax calculation - they are just forms of payment, not unlike any other payment mechanism. Tax calculation happens before payment, not as part of payment.
Let me explain... By default, Gift Certificates are processed through TaxCloud, with a sales tax assigned to them unless you take all Gift Certificates and assign them 10005 as their TIC. Under the default module, you have to include the five digit code as part of the description to the Tax Class. The change that I made is that you don't have to add it this way but instead by adding a field to /admin/tax_class.php and database whereof and adding it there. When the function func_taxcloud_get_tic($product_id) is called, it will see this:
function func_taxcloud_get_tic($product_id) {
global $db;
$query = "SELECT tc.tax_class_tic, p.products_model FROM " . TABLE_PRODUCTS . " as p LEFT JOIN " . TABLE_TAX_CLASS . " as tc ON p.products_tax_class_id = tc.tax_class_id WHERE products_id = " . $product_id;
$result = $db->Execute($query);
if (preg_match("/^(GIFT)/",trim($result->fields['products_model']))) {
$tic = 10005;
return $tic;
} else {
$tic = $result->fields['tax_class_tic'];
$i = preg_match("/^(\d+)/", $tic);
if($i != 0)
return $tic;
else
return $i;
}
}
This function reads as, pull up the tax class TIC AND product model of the item in question. If the Product Model contains the ZenCart keyword of "GIFT" in the beginning of the product model, this is a Gift Certificate and should be assigned a TIC of 10005. All others, continue to search and bring up the TIC of the tax class in question and assign that. (If all else fails, assign it to zero.) So far in my testing of the above, it does return 10005. Essentially this does nothing different from the original function that was made except two things: I make all GIFT models have a TIC of 10005 and I use the TIC field I made instead of the description to look it up. If someone does something silly like put a letter in the TIC field, it still returns 0 as intended.
However making an order with a Gift Certificate alone, meaning that no other items are presented during checkout, ZenCart flags the entire transaction as "virtual". (In fact, anything involving downloads and etc, flags the entire transation as "virtual" or "mixed" in the case of something that's NOT downloadable being in the same cart of something is otherwise virtual.) Upon completion of checkout and going back to TaxCloud's Control Panel, this transaction will NOT register in the Transaction listing when its just by itself. That is, if only a gift certificate was purchased, this transaction will NOT be listed in TaxCloud. Let me prove my case:
First, let's start off with just buying a $5 Gift Certificate:

So far so good, Gift Certificates should NOT be taxed... Transaction finally finishes.... We have an Order Number and email



However, going over to the TaxCloud Panel... this order is NOT listed. At first I thought it was a problem that TaxCloud wouldn't list non-taxable sales. However, during a series of botches with the coding... I discovered that is not the case. TaxCloud would still show non-taxable sales.

The only difference between two instances is that one has a delivery address (the one with the non-downloadable stuff) and one didn't. (the one with just the gift certificate).