close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Is there a way to display prices both including and excluding sales tax?

Thread begun 2/12/2023 11:23 am by Roxana | Last modified 2/23/2023 10:04 am by Ray Borduin | 760 views | 13 replies |

Roxana

Is there a way to display prices both including and excluding sales tax?

I want to display prices on the detail page and in the cart, both including and excluding sales tax.

Is there a way to do that with a calculation without having to add another column in tblprice?

If I have to add another column to the database, is there an easy way to fill it with the calculated values from another column?

Sign in to reply to this post

Ray BorduinWebAssist

I seem to recall you have tax rules based on country and region, so getting that all figured out might be a pain. It is probably going to take some custom coding, but I could certainly help in a 1 hour support session.

I'm sure you are already able to show the price without tax. So showing the tax price is the part you need help with... I'd probably end up writing a function on the page that takes the price and spits out the price with tax. It will just be a bunch of if statements and simple math, but would have to be done by hand.

Sign in to reply to this post
Did this help? Tips are appreciated...

Roxana

Yes, that would be great. When can we set that up? Today?

Sign in to reply to this post

Ray BorduinWebAssist

I can probably do it Wednesday. I'm traveling today. Give me a call at the office number at the bottom of every webassist page on Wednesday at 11am PST and I can help.

Sign in to reply to this post
Did this help? Tips are appreciated...

Roxana

Sounds great. Thanks.

Sign in to reply to this post

Ray BorduinWebAssist

This looks over-complicated to me. Why not just do it all with php? Then you wouldn't need ajax.

I can also help you getting this working though. Maybe you have a good reason to need to use ajax and javascript that I don't realize.

You can convert a string to a number by:
1) removing any currency symbols
2) removing commas and using dot syntax for decimals
3) using parseFloat() on the resulting string

Sign in to reply to this post
Did this help? Tips are appreciated...

Roxana

Hi Ray,

I ran into one more problem.

The code worked based on location, but when I switched to another language, the prices disappeared completely.

When I comment out this code, it works for all languages. When I don't, it works only for English.

The problem is the other languages still need to swap comma for dot.

/*if (languageid != 2) {
x = x.replace(".", ",");
} */
if (languageid != 2) {
y = y.replace(".", ",");
}



I wonder if y is displayed correctly because it is not based on a calculation, and x isn't because it is a calculated value.

I also commented out this

/*if (mylocation3 == "germany" || mylocation1 == "europe") document.getElementsByClassName("itempriceincl").innerHTML = x;	*/



And added it to this line. It didn't have an affect the problem described above.

if (mylocation3 == "germany" || mylocation1 == "europe") {
$('.itempriceincl').html('(' +currencysymbol+' '+x+' '+mwstincl+ ')');
}
Sign in to reply to this post

Roxana

By the way, I am not getting email notifications to this thread even though it is checked. That"s why I saw a few updates too late.

Sign in to reply to this post

Ray BorduinWebAssist

I went over my email quota today accidentally. It will start working again in a few hours.

Sign in to reply to this post
Did this help? Tips are appreciated...

Roxana

Thanks, no rush in regards to the emails.

Sign in to reply to this post
loading

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