# Mix of Taxable & Non Taxable Items

## 7/15/2010 9:20 pm  |  #1 courtyo

### Mix of Taxable & Non Taxable Items

Can eCart handle tax on a per-item basis?

I need to calculate a tax rule where sales tax is only calculated for designated items. I have a column in the cart called "taxable." For each item, tax should be calculated only if the value of this column is 1.

## 7/16/2010 9:58 am  |  #2 Jason ByrnesWebAssist

in the add to cart button, set the value for the taxable column to 12 for items that should be taxed and 0 for items that should not be taxed

Then in the eCart object, set the tax rule up on the tax tab.

Set the trigger to "Number of items With A Specific Column value":
If the total Number of items where 'taxable' has a value of '1' is '>' than a value of '0'

Set the calculation to "based on items with a specific value":
Total of 'TotalPrice' where 'taxable' has a value of '1' 'times' '.10'

replace '.10' with the correct tax rate you wish to use.

## 7/19/2010 9:12 pm  |  #3 courtyo

I'm getting total tax of \$0, even when I have one taxable item in the cart.

I double checked and the value of "taxable" is 12 for the taxable item and 0 for the non taxable item. Here is the eCart code - perhaps I have something set incorrectly?:

function WAEC_moringa_cart_SalesTax() {
\$totalTax = 0;
if (true && ((\$this->GetTaxableTotal() > 0) && ((isset(\$_SESSION['cust_shipst'])?\$_SESSION['cust_shipst']:"") == "CA") && (\$this->ConditionalTotal("Quantity", "taxable", "1") > 0))) {
\$totalTax += (\$this->ConditionalTotal("TotalPrice", "taxable", "1") * .0875);//Result
}
return WA_eCart_FormatNumber(\$totalTax, \$this->ForceDecimalsC, \$this->DecimalPlacesC);
}

## 7/20/2010 3:16 pm  |  #4 Jason ByrnesWebAssist

Sorry, that was a typo in my previous reply, the taxable items need to be set to 1 in the add to cart button, not 12, I guess I had fat fingers when typing the previous instructions.

## 7/21/2010 1:26 am  |  #5 courtyo

Perfect - it worked! Thanks!

You're welcome.

## 1/24/2014 9:43 am  |  #7 Justin@AdventDesign

### Troubleshooting Taxable and Nontaxable

I've followed the above instructions to add item specific tax/notax rules to an existing cart system. However, I'm not getting tax applied and I'm having trouble figuring out where the breakdown is. The detail.php page is pulling the '1' properly from the products table, and the Add from Recordset behavior appears to be passing that same Taxable value correctly. However, the cart.php is showing no tax.

I've attached screen shots of the Sales Tax setup in ecart, as well as the pertinent pages. I should mention, tax is only to be added if the ordering party is in Indiana ('IN') AND the item is marked taxable.

## 1/24/2014 12:51 pm  |  #9 Justin@AdventDesign

See private message...

## 1/24/2014 1:03 pm  |  #10 Jason ByrnesWebAssist

when i go through the checkout page and select indiana as the state, i see the tax applied on the confirm page. see screen shot.

## Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

## Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

## Everything else!

Close Window

Account or customer service questions?

Need technical support?

Content

Layout

Ease of use

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Window

## We were unable to retrieve the attached file

Close Window

### Attach and remove files

• Text Formatting
• Insert Element
• Block Formatting
• Cancel
Close Window

Close Window

#### This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --