## Free, outstanding support from WebAssist and your colleagues

Thread began 10/14/2009 2:43 pm by info323054 | Last modified 11/12/2009 4:33 pm by Jason Byrnes | 6211 views | 31 replies |

## 10/14/2009 2:43 pm  |  #1 info323054

The cart has to calculate the tax value, but since it is already included on the price item, I need the cart to state the figures like this:

Let’s imagine an article that costs 79,92 euros (that is the amount appearing on the catalogue), then:

The catalogue shows: 79,92 and the cart must show this:

Sub-total: 68,90
Tax base: 68,90
Tax amount: 11,02
Total including tax: 79,92

How can I make my cart to work like that?

## 10/14/2009 4:06 pm  |  #2 Jason ByrnesWebAssist

you would need to modify the total price calculation to deduct the tax amount from the sub total, and create a tax calculation to determine the the total tax amount.

You could then create a tax charge to use the tax calculation and display the tax amount as a line item in the cart.

I'm not sure of your exact tax amount, but the totalprice calculation would be:
([Price] - ([Price] * <tax percentage>)) * [Quantity]

Create another calculation called tax:
[Price] - ([Price] * <tax percentage>)

## 10/27/2009 3:51 pm  |  #3 info323054

### Tax calculation

Hi Jason Byrnes,

Please note that the tax percentage is passed through a session variable called TaxRate, since it is taken according to the state the customer states on his form.

In that case, what would be the formula of the total price calculation?, since I want the tax is deducted from the total price in the cart.

You wrote this formula:

([Price] - ([Price] * <tax percentage>)) * [Quantity]

Where the <tax percentage> is there should be the session variable called TaxRate that I have created? How shall I write it for it to work?

Shall I use this on the formula < >?

Please tell me the exact formula I have to write on the calculation.

Thank you for your kind help.

Regards,

Israel

## 10/28/2009 12:22 pm  |  #4 Jason ByrnesWebAssist

if the name of the session variable is "tax" the calculation would be:
([Price] - ([Price] * \$_SESSION['tax'])) * [Quantity]

## 10/29/2009 7:43 am  |  #5 info323054

Originally Said By: Jason Byrnes
if the name of the session variable is "tax" the calculation would be:
([Price] - ([Price] * \$_SESSION['tax'])) * [Quantity]

Now it works. Thank you so much.

You're welcome.

## 11/02/2009 10:41 am  |  #7 info323054

Now I have one problem. I have generated 3 pages: cart.php, checkout.php and confirm.php. In order to get all values correctly in the confirm.php, I have to refresh the page manually. Otherwise, the calculation of the Tax, shipping etc is not done properly. How can I manage this?

## 11/02/2009 4:09 pm  |  #8 Jason ByrnesWebAssist

Just after the body tag on the confirm page add the following code:

php:
``````<?php
\$<cart Name>->GetContent();
?>``````

where "<cart Name>" is the name of your eCart object.

## 11/03/2009 8:34 am  |  #9 info323054

You make things so easy !!! Thank you so much indeed. Very professional. It works perfectly. Thank you again.

## 11/03/2009 9:23 am  |  #10 Jason ByrnesWebAssist

Excellent, glad to hear it worked.

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