close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Two or more currencies

Thread began 12/20/2011 2:32 pm by turbo.sarajevo416658 | Last modified 12/22/2011 6:49 am by turbo.sarajevo416658 | 1158 views | 3 replies

Jason ByrnesWebAssist

this is possible, but will take some custom coding to accomplish.

add the following code to the page where the currency selection will be made at line 1:

php:
<?php

@session_start();
switch((isset(
$_POST['currency']))?$_POST['currency']:"") {
    case 
"USD":
        
$_SESSION['currencySymbol'] = "$";
        
$_SESSION['currencyCode'] = "USD";
        break;
    case 
"EUR":
        
$_SESSION['currencySymbol'] = "&euro;";
        
$_SESSION['currencyCode'] = "EUR";    
        break;
    default:
        
$_SESSION['currencySymbol'] = "$";
        
$_SESSION['currencyCode'] = "USD";    
}
?>




use this code in the body to add the currency select list:

php:
<form id="form1" name="form1" method="post"  action="">

  <label>
    <select name="currency" id="currency">
      <option value="USD" selected="selected">USD</option>
      <option value="EUR">Euro</option>
    </select>
  </label>
  <label>
    <input type="submit" name="button" id="button" value="Submit" />
  </label>
</form>




you will then need to edit the eCart object file to use the dynamically set curency symbol.

in my example, the eCart objec is named eCart4, look for the following code:

php:
$eCart4 = new eCart4_Definition("eCart4", 0, "$", "", true, 2, 0, "oz", true, 2, 1, 0);



in your eCart file, it will be slightly different, anywhere that says "eCart4" substitute with the name if your eCart object

change that to:

php:
$eCart4 = new eCart4_Definition("eCart4", 0, "".(isset($_SESSION['currencySymbol']))?$_SESSION['currencySymbol']:"$"."", "", true, 2, 0, "oz", true, 2, 1, 0);



after running the checkout wizard, you will also need to modify the confirm page, to change the parameter that passes the currency code to the gateway use the dynamic one. this change will be different based on the payment gateway you are using, let me know what payment gateway you plan to use and i can tell you the code that will need to be changed.

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