View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Tax Value Problem

Thread began 11/11/2009 8:13 am by dnys04173367569 | Last modified 11/12/2009 3:15 pm by dnys04173367569 | 856 views | 3 replies

dnys04173367569

I thank you for the quick responce in respect of this problem, but the answer have brough up a few more issues.

The formula stated as stated above:-

([Price] - ([Price] * (isset($_SESSION['Tax'])?$_SESSION['Tax']:"1"))) * [Quantity]

actually reduced the product by 100%.

I have included the following change for those looking at this query.

I have since altered the "1" and tried "0.130434" which is based on a product valued at £100 which already includes VAT/TAX of 15%

i.e. 100% for the Product + 15% for the VAT/TAX = 115%

therefore 100 / 115 = 0.869565.......
then take 1 and subtract the 0.869565
1 - 0869565 = 0.130434 <=== Suggest that this amount is stored at more than 4 decimal places as noticed that I can have a small error of 1p at 4 decimal places ===

([Price] - ([Price] * (isset($_SESSION['Tax'])?$_SESSION['Tax']:"0.130434"))) * [Quantity]

This gives the correct answer of £86.96 net price + VAT/TAX of £13.04 = £100.00

However, my problem is that the formula seems only helpful if I am dealing with one tax rate, i.e. "0.130434" unless I am missing something.

How can I set the $_SESSION['Tax'] so that I can get the relevant tax rate from a database, the tax amount can then change on which country is selected and/or state.

And so that I will not get the error due to the $_SESSION['Tax'] not being set.

Notice: Undefined index: Tax in d:\wamp\www\AB\WA_eCart\AngelBeeStore_PHP.php on line 368

From what you have said earlier I have not set the $_SESSION['Tax'] I guess that the $_SESSION['Tax'] should be setup, not within the calulations but elsewhere normally.

How do I get the TAX from a Database based on a country selected in the purchases profile, which would be far better or if not logged in no tax.

I do appreciate your time and hope that someone can help me in these matters and thanks to DANI for your earlier responce.

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