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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Usd & euro

Thread began 3/05/2009 1:00 pm by lars.martin.engvall294711 | Last modified 3/09/2009 12:24 pm by lars.martin.engvall294711 | 2111 views | 6 replies |

lars.martin.engvall294711

Usd & euro

Anyone who could tell how to let customers display prices in EURO or USD? (PHP)

Sign in to reply to this post

Ray BorduinWebAssist

Do you have set prices in each currency, or do you want to do a currency conversion?

I guess you would first determine how you wanted to expose that option to the end user. It could be done a variety of ways.

Sign in to reply to this post

lars.martin.engvall294711

A currency conversion from EURO to USD. I just want to use one price for each item in the database if possible?

Sign in to reply to this post

Ray BorduinWebAssist

How would you know which price to display to the user? Where are you having difficulty?

It is possible to do any number of ways. You just need to decide what you want to do and what your user experience would be and make it happen. If you get stuck along the way, ask a specific question here and we can help.

Sign in to reply to this post

lars.martin.engvall294711

I'll try to be more specific, I want a link in the header of the pages which says; show prices in: EURO | USD. The prices are shown in EURO by default but if a visitor/customer prefers to use USD he may choose the "USD" and then the page reload and show prices in USD instead of EURO. I also just want to have one coloumn in the database products table for price and that would be in EURO, when showing USD it will be calculated from the price in EURO * exchange rate for USD.

Sign in to reply to this post

Ray BorduinWebAssist

OK, now you asking some questions that can be answered ;)

I guess the easiest way to do it would be to add an include file to the top of every page in your site, so you can manage the functionality from one place.

Then add a variable declaration for the exchange rate. If you want you can get it from the database, or just update this file directly to reflect accurate rates.

You can create and set a sesison variable on the included page to keep track of the currency settings. You can apply the "set session value" server behavior in the general section of ecart to set the value of the session variable to "EURO" if it is not defined to accomplish the desired result.

This will then give you the session variable and the exchange rate on any page where you need it. From there you make your "Show prices in" option simply update that session variable.

Then wherever you reference a price "[pricecode]", you can instead reference it:

(($_SESSION['CurrencyFormatSessionName'] == "USD")?([pricecode]*$_currencyRate):[pricecode])

The same general principal would be used whenever displaying currency in the cart or on the page where you need currency conversion.

Sign in to reply to this post

lars.martin.engvall294711

Thanks a lot Ray, I will try this.

Sign in to reply to this post

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