close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Tax being calculated before discount

Thread began 2/15/2010 12:53 pm by adam106173 | Last modified 2/23/2010 8:59 pm by adam106173 | 5820 views | 11 replies

Eric Mittman

I have taken a look at the cart tax and discount rules. The problem is that tax will be calculated on the total price column. Since the total price for the item does not take into account any discounts you will be taxed on the non discounted amount.

There is another subtotal you could use for the tax, if you choose to base it off of the taxable total then it will take into account the charges and discounts before applying the tax.

The problem with this is that it will still be based on the totalprice of all the items in the cart. The only way that I could think of that would allow this to work for you would be to modify the taxabletotal function so that it only gets the subtotal for the items that have a 1 in the taxable column.

This would allow you to use the taxable total to base the calculation on instead of the one you are using now. To make this change to the taxable total function you would need to locate the function in the WA_eCart_Definition.php file. In here look for this line of code:

php:
function GetTaxableTotal() {



In here you will see that the $taxtotal variable is being set based on the total of the totalprice column. You can replace this line of code with the conditional total code so that it only includes items that have a 1 in the taxable column.

replace this:

php:
$taxTotal  = $this->TotalColumn("TotalPrice");



with this:

php:
$taxTotal  = $this->TotalColumn("TotalPrice") = $this->ConditionalTotal("TotalPrice", "Taxable", "1");



Please give this a try and let us know how it works for you. If you make any changes to your cart this update might be overwritten, so make sure to back up this page after you make the update.

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

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 Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

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 --

Uploading file...